Open ontanj opened 4 years ago
From what I find the time zone is unconditionally appended to the Datetime string before parsing with Moment. This yields all Datetime parseFormats that lack the trailing 'Z' ineffective. Including 5 from the default list.
In Model:
Event.add({ [...] date: { type: Types.Datetime, parseFormat: ['YYYY-MM-DD hh:mm'], required: true, initial: true} [...] })
Setting "2019-11-22 17:30" through Admin UI should be valid.
Currently that's invalid, while setting parseFormat: ['YYYY-MM-DD hh:mm Z'] makes the string "2019-11-22 17:30" valid in Admin UI.
parseFormat: ['YYYY-MM-DD hh:mm Z']
From what I find the time zone is unconditionally appended to the Datetime string before parsing with Moment. This yields all Datetime parseFormats that lack the trailing 'Z' ineffective. Including 5 from the default list.
Behavior
In Model:
Setting "2019-11-22 17:30" through Admin UI should be valid.
Currently that's invalid, while setting
parseFormat: ['YYYY-MM-DD hh:mm Z']
makes the string "2019-11-22 17:30" valid in Admin UI.Environment