I'm writing a streaming TOML generator, and am using toml to validate that the TOML I'm generating is valid. I was hacking on dates tonight and came across this oddity:
> toml.parse('ts1 = 1979-05-27T07:32:00Z')
{ ts1: Sun May 27 1979 00:32:00 GMT-0700 (PDT) }
> toml.parse('ts2 = 1979-05-27T00:32:00.999999-07:00')
{ ts2: Sun May 27 1979 00:32:00 GMT-0700 (PDT) }
> toml.parse('ts3 = 1979-05-27T07:32:00.12Z')
SyntaxError: Expected "+", "-", "_" or [0-9] but "Z" found.
> toml.parse('ts4 = ' + new Date(2017, 7, 10, 8, 34, 12, 666).toISOString())
SyntaxError: Expected "+", "-", "_" or [0-9] but "Z" found.
The workaround for now is to not use Z with fractional times, but that precludes the use of date.toISOString(), which would allow me to avoid depending on moment. It's not a huge deal either way, it's just a surprising limitation.
I'm writing a streaming TOML generator, and am using
tomlto validate that the TOML I'm generating is valid. I was hacking on dates tonight and came across this oddity:The workaround for now is to not use
Zwith fractional times, but that precludes the use ofdate.toISOString(), which would allow me to avoid depending onmoment. It's not a huge deal either way, it's just a surprising limitation.