plaa / TimeShift-js

Library for mocking JavaScript's Date object
MIT License
65 stars 28 forks source link

Return the correct toString() text for invalid dates #15

Closed zoehneto closed 2 years ago

zoehneto commented 2 years ago

According to the ECMAScript spec for the date we have to return Invalid Date if a user constructs an invalid date. Failure to do so means that some libraries (e.g. dayjs) can't recognize that a date is invalid and therefore don't work correctly.

plaa commented 2 years ago

Thanks! Released as 1.2.0.