I have a multilingual site. I have a model with a DateTime? field. I am using pikaday to allow the picking of dates.
I had set up the date to be the format of
'DD/MM/YYYY'
When using the Swedish local the short date it is excecting is yyyy-MM-dd. So the model is not binding the DateTime? field.
I thought when setting the format for pikaday I could use
@Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern
However I can't go from a C# ShortDatePattern to a moment.js pattern.
The following seems to work in my test cases
@Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("yyyy", "YYYY").Replace('d','D')