-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: DataGridDateColumn filter not working properly #5866
Comments
@stsrki thoughts? |
I agree that it works technically but I'm not sure if that is what a user would expect. At least the example should be changed so that the data does not contain time and the filter gives a result when the correct date is selected. Personally I would expect that the filter only compares on date if that is the only thing i can enter. For instance i have a column with the last modified time stamp. This includes also milli seconds which i don't display in the column but it would be impossible to filter on in this way. As a quick 'fix' it would be sufficient to improve the documentation and add a custom filter example that just compares the dates to show how to fix it. |
Yeah, this is known UX problem with dates. I remember it happening all the time when I worked in my previous company on travel agency systems. Users would expect one thing, while technically, it would work perfectly. Anyways, we could assume that the user wants to filter by the entire end date, eg if they select from Another way would be to introduce additional filter modes that could substitute |
Same thing on a company, we did end up doing a more custom filter, but it was correct from a technical point of view due to how the dates are always datetime internally.
If I remember correctly using Between, if you want all the data for a single day, say 2020-01-01. You do Between 2020-01-01 and 2020-01-02. This should get all records for 2020-01-01. But yea I guess I don't expect regular users to know how to do this. |
And what about using a DateOnly for the column in this case ? |
With DateOnly there is no issue. Problem comes with the time component, it must either be entered in the selection or a custom filter must be used to only compare the date part. |
What I meant was more "why using a Date/Time column instead of a DateOnly column if only the date part matters ?" That said, I understand your point. A filter for a DateTime column should be able to deal with both parts. |
Blazorise Version
1.6 1.7
What Blazorise provider are you running on?
Bootstrap5
Link to minimal reproduction or a simple code snippet
https://blazorise.com/docs/extensions/datagrid/columns
Steps to reproduce & bug description
There seems to be an issue when using the filter on DataGridDateColumn , if the column contains date + time then it cannot filter. Happens both on default (datepicker) and native date selection. Only when datepicker is used it might work, then time can be entered in the filter but not picked. This can be seen on the blazorise demo page. The date of birth column has time included which cannot be selected in the filter. And when applying the filter the result is always empty.
Please also add more documentation for the datepicker option in DataGridDateColumn.
What is expected?
If only a date is choosen in the filter then only date should be compared and the time part should be ignored. Perhaps this requires an additional option in DataGridDateColumn
What is actually happening?
filter does not work properly
What browsers do you see the problem on?
Microsoft Edge, Chrome
Any additional comments?
I created a custom filter as a workaround which seems to fix it. However in some cases i noticed that the filter gets a time component when i do not expect it. The column value is DateOnly but it still shows the time in the filter. I will try to make a simple example to see where this goes wrong
The text was updated successfully, but these errors were encountered: