what i would like is to get for example the value D.M.YYYY based on the locale. (in this example, german).
so if locale is english, the output would be M/D/YYYY
there is no pattern property, unless i missed it?
To get the Local Format
Use:
moment.localeData().longDateFormat('L')
This function will return local date format.
That's it.
_So easy!!!!_
i made a mistake. i did not use the local js library. my bad. thank you
what i want to do is actually use the isValid() feature.
Now, if I do this
moment('2', 'M/D/YYYY').isValid()
how come it returns true?
Most helpful comment
To get the Local Format
Use:
moment.localeData().longDateFormat('L')
This function will return local date format.
That's it.
_So easy!!!!_