I want to build a Kendo UI Grid with format date dd//MM/yyyy. However, all questions that I found about this, it were resolved with code Format(\"{0:d}\");. So,
If you want to display datetime format in kendo grid then do this,
.Format("{0:dd/MM/yyyy}")
Or
builder.ToString("dd/MM/yyyy");
Can also use:
columns.Bound(c => c.DateCreate).Format("{0:G}")
As in http://docs.telerik.com/kendo-ui/framework/globalization/dateformatting
Try instead this,this will work.
.ClientTemplate("#= kendo.toString(kendo.parseDate(Date,'dd/MM/yyyy'), '" + CurrentDateFormat + "') #");
The other solutions were close but no cigar... Here's what worked for me:
columns.Bound(c => c.CreatedDate).ClientTemplate("#= kendo.toString(kendo.parseDate(CreatedDate), 'dd/MM/yyyy') #");
I don't know about Kendo UI but it looks to me like you want to pass a string formatted date rather than a DateTime object.
The /Date(...)/
output looks like a JSON formatted date from .Net.
I would convert the date to a string using somthing like myDateTime.ToString("dd/MM/yyyy");
before passing it to the control.
.Format("{0:" + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + "}");
There may be some other options in System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat that might work for you if that is not what you want.