error: locale="de"

Hi,

We have follow error:

Cannot convert undefined or null to object

TypeError: Cannot convert undefined or null to object at Function.keys () at DatePickerComponent.Calendar.getCultureValues (http://localhost:54962/dist/app.bundle.js:110141:38) at DatePickerComponent.Calendar.contentHdr (http://localhost:54962/dist/app.bundle.js:110168:45) at DatePickerComponent.Calendar.content (http://localhost:54962/dist/app.bundle.js:110129:14) at DatePickerComponent.Calendar.render (http://localhost:54962/dist/app.bundle.js:110020:14) at DatePickerComponent.DatePicker.show (http://localhost:54962/dist/app.bundle.js:282526:37) at DatePickerComponent.DatePicker.dateIconHandler (http://localhost:54962/dist/app.bundle.js:282251:18) at ZoneDelegate.invokeTask (http://localhost:54962/dist/polyfills.bundle.js:9372:31) at Object.onInvokeTask (http://localhost:54962/dist/app.bundle.js:4953:33) at ZoneDelegate.invokeTask (http://localhost:54962/dist/polyfills.bundle.js:9371:36)

In app.module.ts :

import { loadCldr, setCulture, setCurrencyCode } from '@syncfusion/ej2-base';
import n1 from './localization/cldr-data/de/ca-gregorian.json';
import n2 from './localization/cldr-data/de/timeZoneNames.json';
import n3 from './localization/cldr-data/de/numbers.json';
import n4 from './localization/cldr-data/de/numberingSystems.json';
import n6 from './localization/cldr-data/de/currencies.json';

loadCldr(n1, n2, n3, n4, n6);

// Syncfusion
setCulture("de");
setCurrencyCode("EUR");

What is wrong?

Regards

j.nord





1 Reply

BC Berly Christopher Syncfusion Team December 14, 2017 05:20 PM UTC

Hi Jürgen, 
  
Thanks for contacting Syncfusion support. 
  
We have looked into your query “error:  locale="de"” and suspect that this issue may be caused due to “de” culture CLDR-Data is not loaded correctly in your application. So, we suggest you to refer the locale scripts as like in the below code example in your app.component.ts file. Also, please ensure all locale related files are referred and loaded correctly in your application to get rid of the reported issue. 
 
[app.component.ts] 
 
declare let require: Function; 
@Component({ 
    selector: 'app-root', 
    templateUrl: './app.component.html' 
}) 
export class AppComponent implements OnInit { 
 
    constructor(private ngEle: ElementRef) { 
        loadCldr( 
           require('../../node_modules/cldr-data/main/de/ca-gregorian.json'), 
           require('../../node_modules/cldr-data/main/de/numbers.json'), 
           require('../../node_modules/cldr-data/main/de/timeZoneNames.json') 
           ); 
  
For your convenience, we have prepared the sample based on your requirement. Please get the sample from the below location. 
  
To know more about Globalization in DatePicker component please refer the below UG Documentation link. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon