Replace new Date().setFullYear(...)
with new Date(Date.UTC(...))
#377
Labels
c: bug
Something isn't working
p: 1-normal
Nothing urgent
s: accepted
Accepted feature / Confirmed bug
Milestone
Describe the bug
We have some code parts in the codebase that resets the year, month and date part of a
Date
but not the time part.These are not safe and deterministic.
Reproduction
new Date().setFullYear(2100, 1, 1) !== new Date(Date.UTC(2100, 0))
Additional Info
Example:
faker/src/datatype.ts
Line 112 in 4d81ac4
The text was updated successfully, but these errors were encountered: