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

Date Column problem.

1 Answer 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ole
Top achievements
Rank 1
Ole asked on 13 Aug 2012, 04:57 PM
Hi,

@(Html.Kendo().Grid<Reviews.Models.ReviewCategorySet>()
.Name("ReviewCategory_#=ReviewID#")
.Columns(columns =>
{
columns.Bound(o => o.TableNo).Width(40).Title("Table 1 No.").Width(50);
columns.Bound(o => o.Category).Width(100).Title("Tekið Út");
//columns.Bound(o => o.Comment);

columns.Bound(o => o.PerformedDate).Title("Dags");
I have a date column bound like this.
First the date gets displayed  like this "Sat May 5 00:00:00 UTC 2012" , which I would like to have "dd/mm/yyyy" .
Tried to put a Format("dd/mm/yyyy") at the end but that did not help.
Then when going into edit mode , the value changes to 05.05.12 00:00 , then when clicking update btn for the row the validation for the date column fails.

I would like to know manipulate the dateformat in the column and also the validation of the column to fit correct date format.

Best

Ole

1 Answer, 1 is accepted

Sort by
0
Ole
Top achievements
Rank 1
answered on 15 Aug 2012, 10:05 AM
Hi,

I managed to get this to work ,

using

Format("{0:d}") and pointing to

script src="@Url.Content("~/Scripts/cultures/kendo.culture.is-IS.min.js")"></script>

and setting culture in javascript
kendo.culture("is-IS");

 

Tags
Grid
Asked by
Ole
Top achievements
Rank 1
Answers by
Ole
Top achievements
Rank 1
Share this question
or