Date.parse() no longer accepts illegal ISO 8601 date/time formats

Published: | Categories: JavaScript

Description

It has been found that the Date.parse static method in Firefox was successfully parsing some illegal ISO 8601 date/time formats. The implementation has been corrected with Firefox 68, and these values will result in NaN from now on:

  • 2018-1-7T00:00Z (no padded zeros in the date, should be 2018-01-07T00:00Z)
  • 2019-05-15T1:1:1 (no padded zeros in the time, should be 2019-05-15T01:01:01)
  • T00:00:00Z (no date)

References