DatePicker column Date Format

I have datepicker column in treegrid control. And below is the code for the same

cols.push({ field: 'Start', headerText: 'Projected Start',editType:'datepickeredit' ,
textAlign: 'left', width: 150,allowEditing:true,isFrozen:false,allowResizing:true, format: { type: 'date', format: 'dd/MM/yyyy' }});
cols.push({ field: 'Finish', headerText: 'Projected Finish', editType:'datepickeredit' ,
textAlign: 'left', width: 150,allowEditing:true,isFrozen:false,allowResizing:true, format: { type: 'date', format: 'dd/MM/yyyy' }});

When I use above it throws error and even below links are not working. how do i enable date format after editing. 


ej2-treegrid.es2015.js:239 [EJ2TreeGrid.Warning]: INVALID FORMAT

For more information, refer to the following documentation links:

Number format: https://ej2.syncfusion.com/documentation//base/intl.html?#supported-format-string.

Date format: https://ej2.syncfusion.com/documentation//base/intl.html?#manipulating-datetime.

Message: TypeError: value.getDate is not a function


1 Reply

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team November 8, 2021 10:45 AM UTC

Hi Parth, 

Greetings from Syncfusion Support. 

Query#:- When I use above it throws error and even below links are not working. how do i enable date format after editing.  
ej2-treegrid.es2015.js:239 [EJ2TreeGrid.Warning]: INVALID FORMAT 
 
From your query we suspect that the reported problem “TypeError: value.getDate is not a function” throws when we bind string value to date column in the dataSource. To resolve the mentioned issue we suggest you to convert the date string value into date object.  

 If we define column.type as the date in the column definition, then it will automatically convert the date string into a date object and the Grid is displayed the date value with your given format. Refer to the documentation link:- 
 
Note: If we use date string as like T00:00:00.000Z , it is a part of ISO-8601 date representation. So for this case if you set type as datetime in column level then it will be converted into the date object in source level.   
 
Also you can refer the below proper documentation links and we will correct the same in our Logger warning :- 

Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 


Loader.
Up arrow icon