When selecting a due date with the date picker, the date format is displayed correctly.
However, on submission the date format month and day are swapped.
The date formats are set as follows:
short_date_format = m-d-Y
normal_date_format = m-d-Y H:i
complete_date_format = m-d-Y H:i T
language = english
time zone = toronto
Ex. i can set the due date to 8/5/2020 (August 5) in the date picker and press submit. When the page reloads, the due date is displayed as 5/8/2020 (May
If i set the due date to 8/28/2020 (August 28) on reload the due date is blank. In the DB, the date is set to 1 as it was invalid when sent (assuming, the attempt was made with month = 28 which is invalid).
Any thoughts?
Due Date Date Picker Inverting Month and Day
Moderators: Developer, Contributor
Re: Due Date Date Picker Inverting Month and Day
SOLVED
The date time picker format is by default set to
$g_datetime_picker_format = 'MM-DD-Y HH:mm'; (in config_defaults_inc.php)
Problem with this is that the strtotime function is that
It sees strings with - in them as dd-mm-yyyy and / as mm/dd/yyyy.
https://stackoverflow.com/questions/855 ... mm-dd-yyyy
Changing the format to
$g_datetime_picker_format = 'MM/DD/YYYY HH:mm';
Works.
The date time picker format is by default set to
$g_datetime_picker_format = 'MM-DD-Y HH:mm'; (in config_defaults_inc.php)
Problem with this is that the strtotime function is that
It sees strings with - in them as dd-mm-yyyy and / as mm/dd/yyyy.
https://stackoverflow.com/questions/855 ... mm-dd-yyyy
Changing the format to
$g_datetime_picker_format = 'MM/DD/YYYY HH:mm';
Works.