From 7141cd7d8a2fd505d3338d13ca29fd1ab7a5dc80 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Thu, 24 Mar 2022 09:14:53 +0100 Subject: fix: datatype.datetime should use static boundaries (#343) --- src/datatype.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 })); -- cgit v1.2.3