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

How to localize dates

2 Answers 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vlad
Top achievements
Rank 1
Vlad asked on 09 Oct 2012, 08:42 PM
Hi,

I have requirements that date should be presented in the browser based on the user system settings in "Region and Language -> Formats -> Short Date", so in US it should be "M/d/yyyy" and in Bulgaria it should be "d.M.yyyy".  I know that Kendo UI supports localization, but I could not figure out how to do that.

This date should be presented in grid and I am using ASP.NET MVC 4.0 with Kendo UI MVC grid control.

Thanks for help.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 12 Oct 2012, 12:42 PM
Hello Vlad,

I suggest you to check the "getting started > globalization"part of the documentation.

http://docs.kendoui.com/getting-started/framework/globalization/overview

In MVC you can use the following logic to load the localization script depending on the current thread culture or use the same approach to load it from other variable.

@{
    var culture = System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
}
 
    <script src="@Url.Content("~/Scripts/cultures/kendo.culture." + culture + ".min.js")"></script>



Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Vlad
Top achievements
Rank 1
answered on 12 Oct 2012, 01:51 PM
Hi Petur,

Thanks for your response.

Yes, I got my code working with proper locale information.

Thanks again.

Sincerely,
Vlad.
Tags
Grid
Asked by
Vlad
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Vlad
Top achievements
Rank 1
Share this question
or