Datepicker - format L giving unexpected result

I have added a datepicker element to a form and selected the L format which I believe should be the DD/MM/YYYY

When I publish the page, though, I get the following for 31st Oct (MM/DD/YYYY):
image

What am I doing wrong? I have made sure the moment component is added to the page and is set to English (United Kingdom) locale.

I know I could set it to fixed DD/MM/YYYY but I would like the option to react to different locales rather than making it static.

Maybe this bug hasn’t been fixed yet:

1 Like

Thanks Ken,
It wouldn’t explain why, when moment is added to the page and set to UK format


that it is still giving MM/DD/YYYY rather than DD/MM/YYYY

Brexit issue.

3 Likes

:rofl: :clap:

Sorry I don’t have anything that actually helps you. :slight_smile:

Would it be possible for this to be looked at for next week’s update, pretty please?

Test in your browser console the following and tell what it returns:

moment().format('L')
moment.locale()

Also check if you included Moment with locales.

image
I didn’t have Moment with Locales added, just ‘normal’ Moment
Now, once added locales, shows:
image
and datepicker uses correct format:
image

Thanks Patrick!
Could the datepicker tooltip be updated to reflect the default MM/DD/YYYY with a note that Moment with locales is required to change it?
or even better adjust to the locale present on the page?