This is a migrated thread and some comments may be shown as answers.

Unique Date Formatting Issue

1 Answer 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 11 Sep 2014, 03:47 PM
I wish I could get as far as all the other users having issues with formatting dates, but I'm stuck right here. The Format method isn't working. My grid is still displaying a Json date looking like this /Date(1364927400000)/. My date field is actually a DateTimeOffset field and I really would rather use a format string like yyyy-MM-dd hh:mm:ss tt K or yyyy-MM-dd hh:mm:ss tt zzz, but /Date(1364927400000)/ is completely unacceptable.


​ @(Html.Kendo().Grid<UtiliPoleOfficeWeb.Models.JobPriorityModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.Id).Hidden(true);
columns.Bound(p => p.Description).Width(150);
columns.Bound(p => p.Priority).Width(100);
columns.Bound(p => p.Owner).Width(100);
columns.Bound(p => p.Started).Format("{0:dd/MM/yyyy}");
columns.Bound(p => p.Inspector).Width(150);
columns.Bound(p => p.Completed).Width(425).Format("{0:dd/MM/yyyy}");
columns.Bound(p => p.FRInspector).Width(140).Title("Field Review Inspector");
columns.Bound(p => p.FRCompleted).Width(425).Title("Field Review Completed");
columns.Command(command => { command.Edit(); }).Width(100);
}) . . .

Please help.

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 15 Sep 2014, 08:25 AM
Hi Timothy,

The problem is caused by the fact that the dates that you pass to the grid are not actually of type date. I would suggest you to check the following forum thread, where an issue similar to yours is discussed, please check it out and if you have any questions, please do not hesitate to contact us:

http://www.telerik.com/forums/format-json-date-in-grid

Regards,
Kiril Nikolov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or