Incorrect date format (bug?)

672
0
02-11-2021 02:37 AM
parmsang
New Contributor II

According to https://developers.arcgis.com/javascript/latest/localization/, the API will automatically use the locale of the browser and we should expect dates to be formatted accordingly. So, if you’re based in the UK you should expect to see dates to be formatted in day/month/year order. However, this is not the case since when the locale is set to ‘en-GB’ the dates are shown in ‘en-US’ format (month/day/year).

This can also be tested on the “Update Feature Attributes” sample here. If you change locale, it doesn't seem to make any difference to the date format for the "Date of inspection" field.

In my case I am using the Editor widget and tried directly modifying the date format via layerInfos/fieldConfig/format as per FieldInfoFormat, but this didn’t work either.

 

It would be really helpful if a working example showing date format being set can be shared.

Tags (4)
0 Kudos
0 Replies