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

Problem with date format

1 Answer 179 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Jayraj
Top achievements
Rank 1
Jayraj asked on 18 Mar 2013, 05:31 AM
Hi,

In my model I have the following property:
/// <summary>
 /// Get or set property for EffDt property.
 /// </summary>
 [DataMember]
[UIHint("EffDateEditor")]
public DateTime? EffDt { get; set; }

whereas my editor template is as follows:
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m).Format("dd-MMM-yyyy"))

Lastly my grid partial has the following:
columns.Bound(p => p.EffDt)
                    .Format("{0:dd-MMM-yyyy}")
                    .Title("Effective Date")
                    .Sortable(false)
                    .Filterable(false)
                    .Width(120);

Now whether I add new data or edit existing data the date column is always throwing validation error as can be seen in the attached file.

Please help this is urgent.

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 19 Mar 2013, 02:22 PM
Hi Jayraj,

 
Most probably the culture of the project is not set correctly - please note that the culture on the client side should be equal to the culture on the server - that way the grid will send the data in format that will be understand by the Default MVC Model binder. I would suggest to check the Grid Globalization demo which shows example of how to correctly setup your project to have equal culture on both the client and the server. You can find this demo in the offline examples which comes with KendoUI for ASP.NET MVC installation.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Date/Time Pickers
Asked by
Jayraj
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or