When adding a "Date" column to a grid that has the filtering feature enabled,
I am receiving the error below after selecting a date to filter on.
Error: Unable to get property 'day' of undefined or null reference
Attached is an example, change extension to html.
What do you mean by "when adding a Date column"? Do you mean to perform CRUD operations on the grid like adding, updating, deleting? In this case you should enable Updating feature as well. Please give me more details around your issue cause I'm not sure I understood it properly.
If I attempt to change the filter condition on the date to, "Today" or "Yesterday" or "This Month". Any filter condition that would execute the filtering action causes the issue.
If i select a Date from the Date picker in the filter, the issue occurs.
I have attached two screenshots
After further investigation of this matter, it seems that from v17.1 the igDataSource doesn't accept Microsoft date formatting (/Date(1234656000000)/). So if the provided data source contains this kind of data you should change it to ISO UTC format, for example: "2009-02-15T00:00:00Z". Here is an article related to this for your reference: https://www.igniteui.com/help/migrating-enableutcdates-option-in-17-1 If you have any questions, please let me know.
I do not believe this is an acceptable solution.
The Microsoft RESTful date format works correctly in the grid as well as with the sorting feature on the grid, which leads me to believe the igDataSource does accept this format.
I also noticed that when applying an ISO 8601 formatted date, the filter works, but if you add a hidden column to the grid with a date type, the filtering still causes the same error.
attached an example of this.
From 17.1 when the date is serialized in the Microsoft format, the data source is not able to de-serialize it properly and keeps it as this string. This may give the impression that some operations work (like sorting) because the data source will execute them on the stored strings and under certain conditions the Microsoft-formatted date will have the same sorting result as the one from sorting the actual dates. Other features, like Filtering, try to execute date-specific expressions on these strings and fail.
As for the issue with the hidden column, this has been determined to be a bug and similarly to the previous one I logged it in our internal tracking system with ID: 241197.
Please note that you will be automatically notified in the case I created previously, once the issue is resolved.
If you have any questions, please let me know.
Development Issue 241197 was included in the service release last October. Please download the latest service release from the my keys and downloads page to get the fix.