@rille wrote:
Hello,
I’m trying to use the ion-datepicker with momentjs, as I use momentjs to show dates in the app currently.
And my problem is that I’m trying to use momentjs to find the date format. I get the date format by doing this:moment().localeData().longDateFormat('ll')
I could mention as well that I’m using reactive forms and setting the default values when creating the form controller.
So here is the problem: If I have the momentjs in US locale I get “MMM D, YYYY” and ion-datepicker will display that when I give it a default value. But if i use Swedish locale I get “D MMM YYYY” and if I give a default value with the same format (e.g 21 Okt 2019) then it will not show that value. Does anyone know why that is?
Also a bonus question, is it possible to change the output value to be something more ISO-8601 format?
Thanks in advance,
eXpliCo
Posts: 1
Participants: 1