Datepicker accepts only date in format yyyy-MM-dd

Hi,
in my datepicker if I insert date with format dd-MM-yyyy I receive an error message:
The value '12-31-2040' is not valid for Date.

let datepicker = new ej.calendars.DatePicker({           
    placeholder: "Seleziona una data",
    format: "dd-MM-yyyy",            
    zIndex: 9999
});

What do I have to change in my code?
Thanks

1 Reply

DL Deepa Loganathan Syncfusion Team October 1, 2018 05:23 AM UTC

Hi Mini, 

Thanks for contacting Syncfusion Support. 

We have validated your query on EJ DatePicker. From the code provided, it seems that you have tried to set value in wrong date format for EJ DatePicker. The value given is in MM-dd-yyyy format instead of the actual date format dd-MM-yyyy, which is set, initially. For your convenience, we have prepared a sample to meet your requirement. Please find the sample from the below link. 

 
Also, check out the following links to explore more about EJ2 DatePicker control. 

 
 
 
Please, let us know if you need any further assistance. 

Regards, 
Deepa L. 


Loader.
Up arrow icon