EitanG
EitanG

Reputation: 221

jQuery DatePicker date format with current calture

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

Answers (1)

Sanyami Vaidya
Sanyami Vaidya

Reputation: 809

You can try this,

var cultureLanguageTag = CultureInfo.CurrentCulture.IetfLanguageTag;
var defaultCulture =  CultureInfo.GetCultureInfoByIetfLanguageTag(cultureLanguageTag);

This gives the default dateformat.

Upvotes: 3

Related Questions