DatePicker format release date

I am trying to use Kendo UI DatePicker

@(Html.Kendo().DatePickerFor(model => model.CalledInAt).Format("dd/MM/yyyy HH:mm tt").Value(DateTime.Now).HtmlAttributes(new { @style = "width:205px" })) 

I am using ASP.NET MVC 4 with an entity framework.

when I try to submit the form, it gives me an error. "Value" 09/09/2013 04:08 AM "Invalid for CalledInAt"

If I change the format to dd / MM / yyyy, then it works. something like below works.

 @(Html.Kendo().DatePickerFor(model => model.CalledInAt).Format("MM/dd/yyyy HH:mm tt").Value(DateTime.Now).HtmlAttributes(new { @style = "width:205px" })) 

what is the reason?

+2
source share
1 answer

Try setting the culture in the web config corresponding to the date format.

 <globalization uiCulture="en" culture="en-AU" /> 

See date support in ASP.NET for different cultures.

+3
source

Source: https://habr.com/ru/post/982433/


All Articles