We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Date formatting with week day

Hi,

I need to format the columns with date to display the weekday: "Th. 03.28.2019". 

How can I do this? What kind of 'format' string I should use?

{ field: 'Date', headerText: 'Date', width: 100, format: { type:'date', format:'dd.MM.yyyy' }, editType: 'datepickeredit', edit: { params: { format:'dd.MM.yyyy' }} },

Thanks!

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team March 29, 2019 06:01 AM UTC

Hi Mladen, 

Greetings from Syncfusion support. 

We can achieve your requirement using the format property of columns API in Grid. 

Refer the below code example. 


var data = new ej.data.DataManager(window.orderData).executeLocal(new ej.data.Query().take(15)); 
    var grid = new ej.grids.Grid({ 
        dataSource: data, 
        columns: [ 
            { field: 'OrderID', headerText: 'Order ID', width: 120, textAlign: 'Right' }, 
            { field: 'CustomerName', headerText: 'Customer Name', width: 150 }, 
 
            { field: 'OrderDate', headerText: 'Order Date', width: 130, format: {type:'date', format:'ccc dd/MM/yyyy'}, textAlign: 'Right' }, 
 
            { field: 'Freight', width: 120, format: 'C2', textAlign: 'Right' }, 
 
            { field: 'ShipCountry', headerText: 'Ship Country', width: 150 } 
        ] 
    }); 
    grid.appendTo('#Grid'); 


We have prepared a simple sample in the following stackblitz link. 


Refer the help documentation. 



Regards, 
Thavasianand S. 



ML Mladen Lakic March 29, 2019 06:44 AM UTC

Hi, Thavasianand

Thank you, that's what I need.


TS Thavasianand Sankaranarayanan Syncfusion Team March 29, 2019 06:45 AM UTC

Hi Mladen, 
 
We are happy that the problem has been solved. 
 
Please get back to us if you need any further assistance.  
                          
Regards, 
Thavasianand S.

Loader.
Live Chat Icon For mobile
Up arrow icon