blazorbootstrap
blazorbootstrap copied to clipboard
Grid: TimeSpan filtering support
Is it possible to add support for TimeSpan filtering in the Grid component?
@sanderweltje Can you share your exact requirement with some examples for better understanding?
I use a TimeSpan in a grid to show the travel time (hh:mm) for an item. It would be nice to filter on this like >,<,=. When you enter a value for the filter it would be nice to use the same format hh:mm. Currently there are no options for filtering, For now I worked around it by setting the PropertyName to a new Property of my TItem that returns TimeSpan.TotalMinutes.
Reference Image:

Notes: Support Days/Hours/Minutes/Seconds
The most convenient way to enter the timespan is by typing it as a string like 01:10 meaning 1 hour and 10 minutes. To support multiple formats a property like timespan format will be useful hh:mm, hh:mm:ss, etc. For my usage I only need hours and minutes but others might need more.