Skip to content
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

Open
blenke opened this issue Nov 21, 2024 · 2 comments
Open

[Bug]: DataGridDateColumn filter not working properly #5866

blenke opened this issue Nov 21, 2024 · 2 comments
Assignees
Labels
Type: Bug 🐞 Something isn't working Type: Possible Bug Needs to investigate more to see if it's an actual bug.

Comments

@blenke
Copy link

blenke commented Nov 21, 2024

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

@blenke blenke added the Type: Bug 🐞 Something isn't working label Nov 21, 2024
@David-Moreira
Copy link
Contributor

@stsrki thoughts?
I guess it kinda works as expected in the world of date time comparisons... since selecting a fitler of "2020-01-01" will be something like midnight, so selecting 2020-01-01 will not be able to display 2020-01-01 10:00 for instance (not with the standard filtering at least).
2020-01-01 00:00 != 2020-01-01 10:00

@David-Moreira David-Moreira added the Type: Possible Bug Needs to investigate more to see if it's an actual bug. label Nov 23, 2024
@blenke
Copy link
Author

blenke commented Nov 24, 2024

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.
Perhaps later an option can be added that would select what to filter on , date, date+hours+minutes or other combinations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working Type: Possible Bug Needs to investigate more to see if it's an actual bug.
Projects
None yet
Development

No branches or pull requests

3 participants