Closed lvillasica closed 4 years ago
hi Leo, thanks for this. Yeah, some date inputs have 0-based months, and some don't. The javascript date object has these ambiguities too. It appears this array-version of a date is 0-based. Maybe it shouldn't be. I'm happy to change it. It will be a breaking change though. Either way, some better documentation about this is in-order, i'm sure. cheers
yeah I know the month is 0-based but the days don't seem to be 0-based as what I am seeing here https://github.com/spencermountain/spacetime/blob/master/src/data/monthLengths.js#L2
Right now I am able to use the number support instead out of the date object spacetime(dateObj.getTime())
and seems to work pretty fine. Thanks so much for responding :)
oh right, 29
is hard-coded, isn't it.
good find!
hey Leo, this is fixed in 6.6.2
thanks for the heads-up.
spacetime([2020, 1, 29])
returns date2020-28-02
.Upon checking the code it lead me to this https://github.com/spencermountain/spacetime/blob/master/src/methods/set/set.js#L113. When month is 1 (February),
n
would be equal to28
becausemax
is equal to28
.