Table DateOnly Filter support #3778
Replies: 3 comments
-
I've encountered the same issue with date filtering in my projects and it can be quite a headache. It seems like there's a real need for a more flexible solution when it comes to date properties, especially when dealing with different types of date fields. I'm hopeful that a fix or a workaround will be introduced soon. Keeping an eye on this thread for updates and fingers crossed for a solution that will adress this issue. |
Beta Was this translation helpful? Give feedback.
-
Hello @davhev8619 @bensch8816 , please try the custom filed filter https://antblazor.com/en-US/components/table#components-table-demo-custom-field-filter |
Beta Was this translation helpful? Give feedback.
-
Thank you @ElderJames . I took the DateTimeFieldFilterType and removed the RemoveMilliseconds function call. It now works with MS SQL db type "date" and "datetime2". I don't know the purpose of RemoveMilliseconds . public class DbDateFieldFilterType : DateFieldFilterType
} |
Beta Was this translation helpful? Give feedback.
-
I would like to have filter support on DateOnly properties on a Table. I currently have a "date" column in my database. If I use a DateOnly property and try to filter I get NotSupportedException (see your code below). If I use a DateTime property I get this SQL query and it doesn't work either.
DateTime C# - date column in SQL =>
DATEADD(millisecond, CAST(CAST(0 - DATEPART(millisecond, [MyDateColumn]) AS float) AS int), [MyDateColumn]) > '2024-04-04'
=> The datepart millisecond is not supported by date function datepart for data type date.
Your supported filter types:
Beta Was this translation helpful? Give feedback.
All reactions