Reputation: 221
I'm using DatePicker with date range and I want to use the current calture format. I know how to get the current calture:
var calture = '<%= System.Globalization.CultureInfo.CurrentCulture.Name %>';
But this does not give me the date format that I need to for the date picker DateFormat. How do I get the current calture date format ?
Upvotes: 1
Views: 258
Reputation: 809
You can try this,
var cultureLanguageTag = CultureInfo.CurrentCulture.IetfLanguageTag;
var defaultCulture = CultureInfo.GetCultureInfoByIetfLanguageTag(cultureLanguageTag);
This gives the default dateformat.
Upvotes: 3