I have an igGrid where one column is a date. For some reason, the date displayed is always one day behind the date's value.
The column definition is:
{ headerText: "Settlement Date", key: "settlement_date", dataType: "date", format: "MM/dd/yyyy" }
I have the page displaying the JSON source data, which is:
[{"settlement_date"=>"2013-04-17", ...
But yet the igGrid displays "04/16/2013" instead of 4/17.
If I change the dataType to "string", then it displays "2013-04-17". So it appears to be Ignite's conversion to "date" that is screwing it up. (This would be ok, except that I can't format it now.)
Can someone please clue me in on what's going on and how I can fix it?
Hello Infragisticians,
I have had also experienced with this date issue(EnableUTCDates) and after going with this thread i've applied below settings which could be helpful of all infragisticians,
gridModel.EnableUTCDates = true;
column.For(x => x.columnDate).HeaderText("Date").Format("dd/MM/yyyy").DataType("date");
Code-Behind:
columnDate = new DateTime(dbDate.Value.Year, dbDate.Value.Month, dbDate.Value.Day, dbDate.Value.Hour, dbDateDate.Value.Minute, dbDate.Value.Second, dbDate.Value.Millisecond, DateTimeKind.Utc);
Best Regards,
I am also having the same issue, I have enabled UTCDates in my grid model through the MVC GridModel() method like this :
GridModel GetGridModel(selectedRow) {
GridModel gridModel = new GridModel(); gridModel.ID = "MyGrid"; gridModel.AutoGenerateColumns = false; gridModel.PrimaryKey = selectedRow.PrimaryKey; gridModel.Width = "100%"; gridModel.Height = "400px"; gridModel.EnableUTCDates = true;
.... ....// other settings
..... ......
return gridModel;
}
1) The date I get from server is 7/1/2012 & the grid displays 6/30/2012 (Here the month & day both are decremented)
2) The date I get from server is 11/11/2014 & the grid displays 11/10/2014 (Here only the day is decremented)
Hello, I am currently experiencing a similar problem to this, I am using the trial version for now but I have a full license.
I set the "enableUTCDates : true" on the grid and this answered the date problem from this post, but when filtering the results are showing the minus one day issue.
I believe this is because the filter is subtracting one day from the entered value (see attached image)
Hello,
My best guess for EnableUTCDates not working as expected in the MVC scenario is that you are not processing the data source through the grid model. When you let the grid model do the remote binding for you, it'll also return the server timezone offset in the response allowing igGrid to modify the dates returned to match the server ones.
It'll be of great help if you could provide a small sample which reproduces the issue.
Best regards,
Stamen Stoychev
I have the same issue, but it doesn't work for me even though I enabled "EnableUTCDates(true). Help appreciated.