inukshuk / edtf.js

Extended Date Time Format (ISO 8601-2 / EDTF) Parser for JavaScript
BSD 2-Clause "Simplified" License
66 stars 12 forks source link

Year > 9999? #9

Closed retorquere closed 8 years ago

retorquere commented 8 years ago

EDTF L1 (not the WD) accepts y170000002 as a valid date, how must I pass that to edtf.js? I've tried removing the leading y but that doesn't do it.

inukshuk commented 8 years ago

See section 4.6 years exceeding four digits. The syntax is now with a capital Y, i.e., Y170000002 or using exponential form Y17E7.

SylvainBigonneau commented 5 years ago

Shouldn't edtf('9999').next() return a Year then ?

Because right now it seems a little confusing that:

let date = edtf('9999').next()
let edtfString = date.edtf // '10000'
let dateCopy = edtf(edtfString)

triggers an error since "10000" is an incorrect EDTF notation, if I understand correctly?

inukshuk commented 5 years ago

Hmm, that's a good question. I think .next() should probably still return a Date. But when formatted to a string it should return it as Y10000. This is definitely tricky...