Hello Prismic community,
I have a little technical question about Prismic's Date API. Actually we receive dates such as
The Date Time String format sent by Prismic is in The ISO8601 Basic format
The problem is that ECMAScript support the ISO8601 Extended format and not the Basic one therfore some browser like safari consider the basic format as invalid.
Calling new Date('2020-09-01T09:39:51+0000') in Safari throws an exception as an invalid Date while with chrome it works well!
ISO 8601 Extended Format is as follows: YYYY-MM-DDTHH:mm:ss.sssZZ is the time zone offset, specified as “Z” (for UTC) or either “+” or “-” followed by a time expression HH:mm
The difference between the extended notation and the basic notation is just the inclusion of the colon in the timezone offset value.
Is it possible to change the date format sent by prismic to be compatible ECMAScript ?