Closed rem4ik4ever closed 3 years ago
hey Rem! yeah, this is a good observation, and something we should tighten-up.
yeah, null
and undefined
were intentional, but the other ones are making me scratch my head.
Lemme think about this a bit. cheers
yeah, I figure false
should behave like null and undefined.
'2011-11-33'
is right to be invalid.
but {}
and []
are both messed-up. They should return the same as null.
thanks
@spencermountain I've been wondering if a strict constructor flag would be useful so people can use it when they might not have the input fully sanitized.
@spencermountain thanks for your response. We usually run our own validation to see if data we pass is indeed a valid date string or object. However there are times where data comes back from server as null and one would assume that it should be invalid however its not.
@jecraig I can see that as a useful feature.
empty []
and {}
now return 'now' like null, false and undefined. released in 6.10.0
.
thanks!
Information
We recently ran into an issue where passing null, undefined values to spacetime was returning current time. I ran a few tests and it appears that passing
undefined, null, false, {}
have this behaviour.I wonder if that is intended behaviour?