Grid date format is not applied

 $(function(){
        var _dm_notes = ej.DataManager([]);        
        var data1 = [{"@odata.etag":"W/\"1993644\"","annotationid":"fc17478b-95b4-e711-8156-e0071b684991","subject":"Busy Bee","notetext":"Jason's Note on Busy Bee Chemist and Newsagency","createdon":"2017-10-19","noteuser_x002e_fullname":"Jason Russell","noteuser_x002e_bkl_usertype":965130000}];
        var data2 = [{"@odata.etag":"W/\"1993651\"","annotationid":"faa6c0f6-95b4-e711-8156-e0071b684991","subject":"Appointment","notetext":"Jason's Note against an Appointment that is regarding a Customer (Busy Bee)","createdon":"2017-10-19","noteuser_x002e_fullname":"Jason Russell","noteuser_x002e_bkl_usertype":965130000}];

        $("#Notes").ejGrid({
            dataSource  : _dm_notes,
            editSettings: { allowEditing: false, allowAdding: false, allowDeleting: false },
            columns     : [
                { headerText: "ID",      field: "annotationid",type: "guid",      visible: false },
                { headerText: "Date",    field: "createdon", type:"datetime", format: "{0:dd.MM.yyyy}" }
            ]
        });
        
        var changes = { "added": data1.concat(data2), "deleted": {}, "changed": {} };
        _dm_notes.saveChanges(changes);
        ej.parseJSON(_dm_notes);
        $("#Notes").ejGrid("refreshContent");

then the data format is not working

1 Reply

MP Manivannan Padmanaban Syncfusion Team May 29, 2020 07:27 AM UTC

Hi Ravikumar, 

Greetings from Syncfusion Support. 

We are able to reproduce the reported issue while using the shared code example. On further analyzing, we could see that the reported issue was occur because the date values as defined as string instead of date object in the dataSource( i.e. data1 & data2).  

To avoid the reported issue, we suggest you to use the date object value for date field. Refer to the modified sample link below, 

Kindly get back to us, if you need further assistance. We will be happy to assist you. 

Regards, 
Manivannan Padmanaban 


Loader.
Up arrow icon