diff options
| author | ST-DDT <[email protected]> | 2022-03-24 09:14:53 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-03-24 08:14:53 +0000 |
| commit | 7141cd7d8a2fd505d3338d13ca29fd1ab7a5dc80 (patch) | |
| tree | 64f15b7adcdde8ecb25a95a7ea1391815028fd79 /src | |
| parent | 301a6d2024816bf40f1091ccffe6bb81cb7ba7b0 (diff) | |
| download | faker-7141cd7d8a2fd505d3338d13ca29fd1ab7a5dc80.tar.xz faker-7141cd7d8a2fd505d3338d13ca29fd1ab7a5dc80.zip | |
fix: datatype.datetime should use static boundaries (#343)
Diffstat (limited to 'src')
| -rw-r--r-- | src/datatype.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/datatype.ts b/src/datatype.ts index 706ed60e..5dc1793c 100644 --- a/src/datatype.ts +++ b/src/datatype.ts @@ -130,11 +130,11 @@ export class Datatype { let max = typeof options === 'number' ? options : options?.max; if (typeof min === 'undefined' || min < minMax * -1) { - min = new Date().setFullYear(1990, 1, 1); + min = Date.UTC(1990, 0); } if (typeof max === 'undefined' || max > minMax) { - max = new Date().setFullYear(2100, 1, 1); + max = Date.UTC(2100, 0); } return new Date(this.faker.datatype.number({ min, max })); |
