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

formatting DatePicker date format without changing it's Culture

1 Answer 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard Orechovsky
Top achievements
Rank 1
Richard Orechovsky asked on 05 Mar 2013, 01:31 PM
My application has to use a specific format of dates, i.e. "10Nov13". This format has to be used in all cultures and should work as a unified format for all languages.
With DatePicker, I did set the Format to "ddMMMyy", which works pretty well for en-US, but for cs-CZ I get "101013".
If I set DatePicker's Culture to "en-US", I'm able to achieve the correct format, but the display language is always english, which is not good with a multilingual app.
Is there a way to format dates without specifying the Culture for entire widget? Something like .Format("ddMMMyy", "en-US")?

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 07 Mar 2013, 04:04 PM
Hi,

The culture scripts are generated based on the .NET cultures in which the abbreviated month names are numbers:

var culture = new System.Globalization.CultureInfo("cs-CZ");
string[] names = culture.DateTimeFormat.AbbreviatedMonthNames;
You could override to use the names instead of numbers you could override the "namesAbbr" array in the kendo.culture.cs-CZ.min.js file. Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Richard Orechovsky
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or