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

How to specify formate for Date Row or Column

With the PivotGrid control is there a way to specify the format for a row or column that is a date value? Here is an example of how a row is currently displaying: "Tue May 10 2016 00:00:00 GMT0-0400 (Eastern Standard Time)". I would like for it to display as 05/10/2016.

Regards, Jeff

5 Replies

RG Ramesh Govindaraj Syncfusion Team May 11, 2016 11:05 AM UTC

Hi Jeffrey,

Thank you for contacting Syncfusion support.

We have created an incident to log an improvement task on behalf of you. Our support engineer will assist you through incident. We request you to follow with the incident for further details.
 
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards, 
Ramesh G. 



MA Manolo March 17, 2017 10:26 AM UTC

How did you solve the problem?


SP Sastha Prathap Selvamoorthy Syncfusion Team March 20, 2017 12:55 PM UTC

Hi Manola, 
 
We have created an incident behalf of you for your requirement. And, we have updated the way to achieve your requirement in the incident. Please find the below link to redirect the incident. 
 
 
Note: We have already mentioned this in our previous update in the forum. 
 
If this doesn’t meets your requirement. Kindly provide us more information about your requirement which would be helpful for us to proceed further. 
 
Regards, 
Sastha Prathap S. 



MA Manolo March 21, 2017 08:40 AM UTC

Hi,

I'm sorry, but I can't find the solution. This post was created in 2016.

In your link, I can't see the solution, only my support tracks, but it is not mine.

Can you post the solution?



RG Ramesh Govindaraj Syncfusion Team March 22, 2017 12:23 PM UTC

Hi Manolo, 

We regret you to inform that, for relational data source, it is not possible to change row/column headers to required format in PivotGrid internally. But, it can be achieved in sample level by following ways. 
1.       You can directly bind the raw data-set (JOSN data) in desire format for date field to display in PivotGrid. (or) 
2.       You can use the “load” event to convert the desired date format of the datasource data (raw data) and bind it to PivotGrid to change the formatting in desired headers. Please find the below code example to achieve this. 
 
Sample Code: 
 
 
    function onLoad(args) { 
        for (var i = 0; i < pivot_dataset.length; i++) { 
            var val = (pivot_dataset[i])["Date"];     // Select field to set desired date format 
            val = new Date(val); 
            //ej.widgetBase.formatting("{0:" + DateTime format string + "}", value, localization); 
            pivot_dataset[i].Date = ej.widgetBase.formatting("{0:" + "MM'/'dd'/'yyyy" + "}", val, "es-ES");   // To convert the date format as per the applied format string and localization 
        } 
        args.model.dataSource.data = pivot_dataset; 
    } 
 
 

Thanks and Regards, 
Ramesh G



Loader.
Live Chat Icon For mobile
Up arrow icon