inukshuk/edtf.js

Invalid upper bound with dates before 1970-01-01

Closed this issue · 4 comments

Hi!
I notice that if i try to add an interval with an unknown start it fails it the "end" is lower than 1970. Doing "../1960" works but has another meaning.

Looking at the code it seems like there is a missing check for this.lower being null?

edtf.js/src/interval.js

Lines 93 to 94 in 36f756f

if (this.lower !== Infinity && value <= this.lower)
throw new RangeError(`invalid upper bound: ${value}`)

Could you post full examples that fail for you? I understood this to mean that "/1960" fails, but this seems to work fine (see the test cases added in the commit above).

Sry, for the bad issue. I have created a PR now with failing test in first commit and a fix in the second. Unsure if this would have some side effects, but the other test are ok after the fix.

#45

Landed in 4.4.2.

Thx, for the quick merge :-)!