Long Number as Date into Grid Field

I have a working and happy ejs-grid.  Getting my data from server side.  Filter, and Sort all happy.


BUT, within it, i have a Date column:

<e-column field='createdDate' headerText='My Date'  width=150></e-column>


From my server side data, I am getting Date back as a long (console.log example from a row below):

Image_6919_1697526416011


I assume there is a simple method to turn this into a Date in a Column, but I have been unable to work it out.  Are you able to offer some suggestions please?  Its a full long Date Time, but in reality I only need YYYY-MM-DD, but at this stage I cant even work that out.


Would appreciate any assistance/ideas please.


Matt



2 Replies

MB Matt Benett October 20, 2023 06:23 AM UTC

Any thoughts on this please.  I am at a loss.



VS Vikram Sundararajan Syncfusion Team November 1, 2023 12:30 PM UTC

Hi Matt Benett,


Greetings from Syncfusion support,


Based on your query you are facing issue with long date and time, want to display the date in the format. You can achieve your requirement using by format option in date. Please refer the below code snippet,


  [app.vue]

 

<e-column field='createdDate' headerText='My Date' width=150

  format='yyyy-MM-dd'></e-column>

 


In this example, the format attribute is set to 'yyyy-MM-dd', which represents the date format 'Year-Month-Day.' This will format the long number as a date in the "YYYY-MM-DD" format. Also please refer the below documentation for more reference,


Formatting: https://ej2.syncfusion.com/vue/documentation/grid/columns/columns#date-formatting


Please let us know if you have any further queries.


Regards,

Vikram S


Loader.
Up arrow icon