behaviour of S.parseDate is unspecified for some inputs
davidchambers opened this issue · comments
MDN:
Note: parsing of date strings with the
Date
constructor (andDate.parse
, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.
#455 is an example of problems that arise when one relies on implementation-dependent behaviour.
It's possible that S.parseDate
could reject strings in formats we know to be handled inconsistently. This may not be practical, in which case we should remove the function from the library. @syaiful6 raised the possibility of creating a dedicated library for parsing date strings in various formats. :)
📆