Hello,
I am trying to enable the date filtering in the Grid component. Because the formats of the dates are not in en-US we need to format the dates so users can enter the relevant information into the filter.
Upon trying to use the following code to load the locale:
The locale folder got copied from the installed folder from cldr-data.
The grid component is initialized like this:
Everything displays as it corresponds, but there is an error thrown in the console when the Calendar Icon button is clicked on a column of type Date:
The error is:
Uncaught TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at CalendarBase.getCultureValues (calendar.js:284:1)
at CalendarBase.createContentHeader (calendar.js:320:1)
at CalendarBase.createContent (calendar.js:268:1)
at Calendar.createContent (calendar.js:2199:1)
at CalendarBase.render (calendar.js:140:1)
at Calendar.render (calendar.js:2055:1)
at DatePicker.show (datepicker.js:1183:1)
at DatePicker.dateIconHandler (datepicker.js:557:1)
-------------------------------------------------------------
CalendarBase.prototype.getCultureValues = function () {
var culShortNames = [];
var cldrObj;
var dayFormat = 'days.stand-alone.' + this.dayHeaderFormat.toLowerCase();
if (this.locale === 'en' || this.locale === 'en-US') {
cldrObj = (getValue(dayFormat, getDefaultDateObject()));
}
else {
cldrObj = (this.getCultureObjects(cldrData, '' + this.locale));
}
for (var _i = 0, _a = Object.keys(cldrObj); _i < _a.length; _i++) {
var obj = _a[_i];
culShortNames.push(getValue(obj, cldrObj));
}
return culShortNames;
};
Could you please let me know what is it that I am missing?
The libraries versions used are:
Hi GUU,
The reported issue will occur only when we miss loading the culture files “ca-gregorian”, “numbers”, “timeZoneNames” while rendering Calendar components with locale. Please refer to the below documentation.
https://ej2.syncfusion.com/react/documentation/calendar/globalization/
From your code, we could see that you have loaded the corresponding files, but we could not reproduce on our end. So, could you please provide the below details which will be helpful for us to provide a better solution as early as possible?
Regards,
Pavithra S