Grid Filter options fails for date fields

I try to set up grid date filter for a date field with content like "2021-08-10T06:30:00.000Z". Filter works with a date object, but not with the original string.

(Version used 18.4.44)

In HTML:

<e-column
field="Start"
[headerText]="Start"
type="date"
[format]="dd.MM.yyyy"
width="100"
[allowFiltering]="true"
></e-column>

Date (provided as string) is formatted correctly, but when I try to open the column filter I get an error and the app fails with the following error:

core.js:4127 ERROR Error: Uncaught (in promise): TypeError: value.getDate is not a function

TypeError: value.getDate is not a function

    at date-formatter.js:118

    at ValueFormatter.push../node_modules/@syncfusion/ej2-grids/src/grid/services/value-formatter.js.ValueFormatter.toView (value-formatter.js:49)

    at ExcelFilterBase.push../node_modules/@syncfusion/ej2-grids/src/grid/common/checkbox-filter-base.js.CheckBoxFilterBase.createFilterItems (checkbox-filter-base.js:830)

    at ExcelFilterBase.push../node_modules/@syncfusion/ej2-grids/src/grid/common/checkbox-filter-base.js.CheckBoxFilterBase.processDataSource (checkbox-filter-base.js:688)

    at ExcelFilterBase.push../node_modules/@syncfusion/ej2-grids/src/grid/common/checkbox-filter-base.js.CheckBoxFilterBase.dataSuccess (checkbox-filter-base.js:669)

    at checkbox-filter-base.js:626

    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:386)

    at Object.onInvoke (core.js:28144)

    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:385)

    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.run (zone.js:143)

    at resolvePromise (zone.js:832)

    at zone.js:898

    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)

    at Object.onInvokeTask (core.js:28132)

    at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)

    at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)

    at drainMicroTaskQueue (zone.js:601)

    at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:507)

    at ZoneTask.invoke (zone.js:492)

    at timer (zone.js:3034)


1 Reply

MS Manivel Sellamuthu Syncfusion Team August 10, 2021 11:32 AM UTC

Hi Julius, 

Greetings from Syncfusion support. 

From the query we can understand that you have defined the date columns values in string format in the Grid’s dataSource. we would like to let you know that the date column values present in the Grid’s dataSource need to be in Date object format as the date column operations(like, filtering, sorting, etc.) are done on the basis of date objects in the source-level. This is the Grid’s default behavior. So, if the date value is provided as string then please provide the date values in Date object format to resolve the problem. 


Please let us know if you need further assistance. 

Regards, 
Manivel 


Loader.
Up arrow icon