problems setting culture with ej2 Scheduler

Hello everyone,
I'm trying to use the ej2 Scheduler setting the base culture to Italian but I enconter an error I can't deal with: the Scheduler does not lot and the  Chrome console says:

ej2.min.js:1 Uncaught TypeError: Cannot read property 'months' of undefined
    at Function.e.dateFormat (ej2.min.js:1)
    at e.getDateFormat (ej2.min.js:1)
    at e.formatDate (ej2.min.js:1)
    at e.getDateRangeText (ej2.min.js:1)
    at e.getItems (ej2.min.js:1)
    at e.renderToolbar (ej2.min.js:1)
    at e.renderHeader (ej2.min.js:1)
    at new e (ej2.min.js:1)
    at t.renderElements (ej2.min.js:1)
    at t.initializeResources (ej2.min.js:1)

Here is the code in the html page,

<script type="text/javascript">

    loadCultureFiles('it'); // in Lib/SyncFusion/Helper.js
    ej.base.setCulture('it'); //set culture file globally 
    ej.base.setCurrencyCode('EUR'); //set currency code globally 

    var scheduleObj = new ej.schedule.Schedule({
        height: '800px',
        showWeekend: true,
        dateFormat: 'dd-MMM-yyyy',
        timeFormat: 'HH:mm',
        timeZone: 'UTC',
        firstDayOfWeek: 1,
        workDays: [1, 2, 3, 4, 5],
        //selectedDate: new Date(2019, 0, 10),
        //eventSettings: { dataSource: data },
        //dragStart: function (args) {
        //    args.navigation.enable = true;
        //}
    });
    scheduleObj.appendTo('#Schedule');
</script>

This is the loadCultureFiles function:

<script type="text/javascript">

    loadCultureFiles('it'); // in Lib/SyncFusion/Helper.js
    ej.base.setCulture('it'); //set culture file globally 
    ej.base.setCurrencyCode('EUR'); //set currency code globally 

    var scheduleObj = new ej.schedule.Schedule({
        height: '800px',
        showWeekend: true,
        dateFormat: 'dd-MMM-yyyy',
        timeFormat: 'HH:mm',
        timeZone: 'UTC',
        firstDayOfWeek: 1,
        workDays: [1, 2, 3, 4, 5],
        //selectedDate: new Date(2019, 0, 10),
        //eventSettings: { dataSource: data },
        //dragStart: function (args) {
        //    args.navigation.enable = true;
        //}
    });
    scheduleObj.appendTo('#Schedule');
</script>


Thank you for your time (and infinite patience!),
Domenico

5 Replies 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team May 7, 2021 11:20 AM UTC

Hi QED, 

Greetings from Syncfusion Support..! 

We have validated your shared snippets at our end and suspect that you may not include the culture-related files and also didn’t assign the locale property for the Scheduler which could be the reason for your reported problem.  

We have prepared a sample using “it” culture for the Scheduler, which can be downloaded from the following link. 


Kindly refer to the above sample, if the issue persists still share the below details to validate your reported issue and serve you better. 
  • Share the culture files used at your end
  • If possible, replicate the issue in the above sample.
  • Share the issue replicating sample (if possible) to validate further at our end.
 
We will be happy to assist you..! 
  
Regards, 
Hareesh 


Marked as answer

QE QED May 7, 2021 11:32 AM UTC

Hi Hareesh, it works like a charm! 
Thank you very much!

(What was the problem, by the way?)


NR Nevitha Ravi Syncfusion Team May 10, 2021 08:42 AM UTC

Hi QED, 

You are most welcome, as mentioned earlier you might missed to include culture related files like ca-gregorian.json, numbers.json, numeringSystems.json, timeZoneNames.json in your application which could cause the reported problem. Please get back to us if you need any further assistance. 

Regards, 
Nevitha 



QE QED May 10, 2021 09:21 AM UTC

Hi,
I think I have a similar problem with ej2 dataGrid filtering on a column of type date (a missing culture . Pls see screenshot.






SK Sujith Kumar Rajkumar Syncfusion Team May 11, 2021 08:26 AM UTC

Hi QED, 
 
Based on the provided information we suspect that you might be facing problem because of not loading the required culture files for the calendar control(rendered in the Grid filter). So we suggest you resolve this by loading the following culture files from the cldr-data of the ’node modules’ – ['ca-gregorian.json', 'numbers.json', 'currencies.json', 'timeZoneNames.json'] from the required culture present inside the main folder(‘it’ culture for your case) and also [ 'numberingSystems.json', 'weekData.json'] files from the supplemental folder in your sample. 
 
Please find the EJ2 Grid sample prepared based on this for your reference, 
 
 
 
Let us know if you have any concerns. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon