On `iOS`/`iPad` Safari browser engine the JavaScript `Date` fails to parse `ISO 8601` date+time inputs where the date and time are delimited by a white-space instead of the `T` character (e.g. `2022-03-22 17:51:57`): The `Date` constructor fails with `Invalid date format`. The usage of a white-space as delimiter between date and time isn't specified by ISO 8601, but is allowed by the RFC that is mostly used on the web. Most Browsers and JavaScript libraries support and output `ISO 8601` formatted dates with date+time delimited by a white-space (`Chrome` (`Blink`/`Chromium`); `Firefox` (`Gecko`); `FeathersJS`; ...). Code demonstration: `new Date('2022-03-22 17:51:57')` Live demonstration: https://playcode.io/879708/
Created attachment 456271 [details] Live demonstration of the issue
(In reply to strarsis from comment #0) > On `iOS`/`iPad` Safari browser engine the JavaScript `Date` fails to parse > `ISO 8601` date+time inputs where the date and time are delimited by a > white-space instead of the `T` character (e.g. `2022-03-22 17:51:57`): > The `Date` constructor fails with `Invalid date format`. > > The usage of a white-space as delimiter between date and time isn't > specified by ISO 8601, but is allowed by the RFC that is mostly used on the > web. Note that ECMAScript spec is "date-times based upon a simplification of the ISO 8601"[1], not a ISO 8601 or RFC. So using space here is implementation-dependent behavior (spec only accepts "T" case.) But it can be a good extension. [1]: https://tc39.es/ecma262/#sec-date-time-string-format
Ah, I extended it in bug 235468. *** This bug has been marked as a duplicate of bug 235468 ***