Hello,
I have to display a column of type "Date". My data source provides a field "CreationDate" formatted like "dd/MM/yyyy". The problem is that the grid does not "understand" the value properly.
Data source example:"31/12/2013" (= December 31, 2013)
Result in the grid:7/12/2015
Is it possible to define the input format of a date type field?
Thanks in advance,Olivier
Hello Olivier,
You can change the format of the column to show date in "dd/MM/yyyy" format as shown below:
{ headerText: "ProductDate", key: "ProductDate", dataType: "date", format: "dd/MM/yyyy" },
Refer to the format in columns node from the “OPTIONS” tab on the link below:
http://help.infragistics.com/jQuery/2012.2/ui.iggrid
I hope this helps.
My issue is the data source format and not the display. I get a json array which contains a field "CreationDate" with the following format "dd/MM/yyyy" and this is not properly processed by the grid. I'd like to know if it is possible to define the input format.
Thank you for your help,
Olivier
I also have this date formatting problem as a result of my Json data.
jsonData[0].TradeDate looks like this when I use debugger : TradeDate = "/Date(-62135578800000)/"
and in my Grid's columns def, I have :
columns: [
{ headerText: "Account", key: "Account", dataType: "string" },
{ headerText: "Trade Date", key: "TradeDate", dataType: "date", format: "MMM-dd-yy" },
]
but my TradeDate appears as "Jan01-01" .
How can I solve this one ?
thanks.
Bob
I am just following up to see if you need any further assistance with this matter.
Thank you for the follow up. igGrid uses the Microsoft convention which looks like "/Date(1359652468774000)/" to format dates.
If you want igGrid to understand your date field in the JSON you should have string in the format "\/Date(1359652468774)\/" or an instance of JavaScript Date object ( like var mydate = new Date(31/12/2004);)
Any idea to accomplish this ?
Thanks,Olivier