I have been trying to make Kendo MVC be able to display dates like "March 5 2013" using Kendo MVC.
I am also using JQuery Validator. It is very unclear to me how the validator and the date format work together, and I cannot see any documentation for how this works, and can be adjusted.
Code in the CSHTML file :
@(Html.Kendo().DatePickerFor(m => m.StartDate).Format("yyyy-MM-dd")
in my CS m.StartDate is just a .net DateTime object.
I have found that no matter what, I cannot get the dates to bind correctly in chrome unless I use the date format above (If I do not supply dates in the above format, the date field is blank)
I have added the locale specific scripts, so that doesn't appear to be an issue.
I have also tried applying
[DisplayFormat(DateFormatString="MMMM dd yyyy")] to the StartDate object being passed through in my model.
It seems like the Date handling for non locale specific dates in Kendo is really badly broken - I am hoping that I am missing something.
Looking at the data being passed to the browser, it appears that it uses the DateFormatString to define how to send the data across the wire, and then relies on the client JavaScript having the correct locale defined so that the two match. This in my opinion is just asking for trouble, and very fragile.
Is there a way that we can define a single format (regardless of locale ) to send across the wire, and the use the displayformat ONLY to display the data?
I have searched the forums, and looked through the documentation, but alas, I cannot see a way to make this work sensibly.
There does not seem to be a custom date format example anywhere that works :(
Please correct me if I am wrong.