DateOnly Query Filtering #1259

Closed
opened 2026-01-29 17:51:15 +00:00 by claunia · 5 comments
Owner

Originally created by @SeanMartz on GitHub (Jun 7, 2024).

Is your feature request related to a problem? Please describe.

Hello, I'm looking to be able to have similar functionality as DateTime and DateTimeOffset in the RadzenDataGrid when filtering with a DateOnly

Describe the solution you'd like

I tried to implement the functionality via PR #1545. But it looks like it was reverted with #1546.

Additional context
Is there something that was missed or broken by 1545? I would be happy to look into the additional work to fix things and get this functionality added!

Thanks!

Originally created by @SeanMartz on GitHub (Jun 7, 2024). **Is your feature request related to a problem? Please describe.** Hello, I'm looking to be able to have similar functionality as `DateTime` and `DateTimeOffset` in the `RadzenDataGrid` when filtering with a `DateOnly` **Describe the solution you'd like** I tried to implement the functionality via PR #1545. But it looks like it was reverted with #1546. **Additional context** Is there something that was missed or broken by 1545? I would be happy to look into the additional work to fix things and get this functionality added! Thanks!
Author
Owner
@enchev commented on GitHub (Jun 7, 2024): https://forum.radzen.com/t/error-message-on-all-radzen-pages/17529/9?u=enchev
Author
Owner

@SeanMartz commented on GitHub (Jun 7, 2024):

Ahh - So to summarize:

the error was caused by changing the BirthDate datatype on the Employee model to a DateOnly?. but that change was not propagated to the Northwind Data Service hosted at services.radzen.com/odata.

So when a request like this was made:

https://services.radzen.com/odata/Northwind/Employees?$top=4&$skip=0&$expand=NorthwindOrders($expand=Customer)&$count=true

the resulting JSON returned a DateTime not a DateOnly.

System.Text.Json does not have built in support for deserializing a DateTime to a DateOnly .

In theory, one could write a custom deserializer (https://stackoverflow.com/questions/71021064/serialize-json-from-object-to-string-dateonly), but I don't think that would support the filter functionality on the server side...

I think the easiest change is to re-add the functionality, without changing any of the models datatypes, unless it can be done in concert.

Open to any thoughts!

@SeanMartz commented on GitHub (Jun 7, 2024): Ahh - So to summarize: the error was caused by changing the `BirthDate` datatype on the `Employee` model to a `DateOnly?`. but that change was not propagated to the Northwind Data Service hosted at `services.radzen.com/odata`. So when a request like this was made: > https://services.radzen.com/odata/Northwind/Employees?$top=4&$skip=0&$expand=NorthwindOrders($expand=Customer)&$count=true the resulting JSON returned a `DateTime` not a `DateOnly`. `System.Text.Json` does not have built in support for deserializing a `DateTime` to a `DateOnly` . In theory, one could write a custom deserializer (https://stackoverflow.com/questions/71021064/serialize-json-from-object-to-string-dateonly), but I don't think that would support the filter functionality on the server side... I think the easiest change is to re-add the functionality, without changing any of the models datatypes, unless it can be done in concert. Open to any thoughts!
Author
Owner

@enchev commented on GitHub (Jun 7, 2024):

I’ll recheck it on Monday, and will publish update if everything works correctly.

@enchev commented on GitHub (Jun 7, 2024): I’ll recheck it on Monday, and will publish update if everything works correctly.
Author
Owner

@SeanMartz commented on GitHub (Jun 7, 2024):

Sounds good! Have a nice weekend!!

@SeanMartz commented on GitHub (Jun 7, 2024): Sounds good! Have a nice weekend!!
Author
Owner

@SeanMartz commented on GitHub (Jun 10, 2024):

Looks like this was merged in via PR #1548. Closing this issue. Thank you!

@SeanMartz commented on GitHub (Jun 10, 2024): Looks like this was merged in via PR #1548. Closing this issue. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1259