Friday 15 February 2013

Kendo grid cultures

I had a Telerik kendo grid bound to a data service implemented via a Grid Controller.

When I upgraded the version of Kendo I noticed that after a row update, date rows were being either set as NULL or DateTime.MinValue. Furthermore, other dates were being set in US format (e.g. mm/dd/yyyy).

Clearly date ranges where the day component was > 12 were failing, a classic culture problem.
Yet my code still called kendo.culture("en-GB") in the document ready function as before.
Examining the kendo.cultures object I could see that the culture was en-US, despite my call above.

What was the problem? It transpires that when I created a new folder for the new version scripts, I neglected to copy the cultures subfolder. In that event calling kendo.culture("en-GB") fails gracefully, leaving you with a US culture.

No comments:

Post a Comment