In my plugin I have a datetime field defined in the settings template:
{{ forms.dateTimeField({
label: "Ends at"|t('optimum'),
instructions: experiment.isNew ? 'Defaults to 30 days from now' : '',
id: 'endAt',
name: 'endAt',
value: experiment.endAt ?? defaultEndAt,
errors: experiment.getErrors('endAt')
}) }}
When I use the picker I get a date in mm/dd/yyyy
format.
This is then sent to the backend and parsed back to a Carbon
instance.
This is what I'm seeing on my end:
However, it seems that the date format is not consistent across installations.
As you can see in this issue, the user reports that the datepicker populates the date in dd/mm/yyyy
format, which breaks the functionality as the backend is expecting mm/dd/yyyy
format.
How can I enforce a uniform format?