I am not sure, if we can achieve this. However, I would like to know if there is a way we can find what is pattern of date based on locale.
What I am trying to achieve is placeholder text inside datepicker? Depending on locale, my function should figure out date pattern for that locale.
For example, when navigator.language is "en-us" date pattern is mm/dd/yyyy.
if navigator.language is "fr" date pattern should be "dd/mm/yyyy"
Reading MDN docs about Intl.DateTimeFormat, I can pretty much get pattern using following code:
console.log(new Intl.DateTimeFormat(navigator.language).resolved.pattern) // M/d/y for "en-us"
but the above code won't give me mm/dd/yyyy or I was not able to find any docs that can help me get that.
Any suggestion?
Thanks
Viral
War10ck this is custom dateTimepicker.. – Viral Jan 15 '15 at 20:50