blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

Grid: TimeSpan filtering support

Open sanderweltje opened this issue 3 years ago • 4 comments

Is it possible to add support for TimeSpan filtering in the Grid component?

sanderweltje avatar Sep 02 '22 22:09 sanderweltje

@sanderweltje Can you share your exact requirement with some examples for better understanding?

gvreddy04 avatar Sep 03 '22 04:09 gvreddy04

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.

sanderweltje avatar Sep 04 '22 17:09 sanderweltje

Reference Image: image

Notes: Support Days/Hours/Minutes/Seconds

gvreddy04 avatar Sep 05 '22 03:09 gvreddy04

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.

sanderweltje avatar Sep 05 '22 05:09 sanderweltje