From b95f4993ab5031886b528127cc74985895f6d523 Mon Sep 17 00:00:00 2001 From: Matt Mayer Date: Sat, 4 Mar 2023 21:22:16 +0700 Subject: [PATCH] add info block, fix list of relative-date methods --- docs/guide/usage.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/guide/usage.md b/docs/guide/usage.md index 7182a3463a6..7bb8f7bc83d 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -108,9 +108,11 @@ const secondRandom = faker.number.int(); console.log(firstRandom === secondRandom); ``` -Note that when upgrading to a new version of Faker, you may get different values for the same seed, as the underlying data (lists of names, words etc) may have changed. +::: info NOTE +When upgrading to a new version of Faker, you may get different values for the same seed, as the underlying data (lists of names, words etc) may have changed. +::: -There are a few relative date methods for which setting a random seed is not sufficient to have reproducible results, specifically: `faker.date.soon`, `faker.date.birthdate`, `faker.date.soon` and `faker.date.recent`. This is because these methods default to creating a date before or after "today", and "today" depends on when the code is run. To fix this, you can specify a fixed reference date as a Date or string, for example: +There are a few relative date methods for which setting a random seed is not sufficient to have reproducible results, specifically: `faker.date.past`, `faker.date.future`, `faker.date.birthdate`, `faker.date.recent` and `faker.date.soon`. This is because these methods default to creating a date before or after "today", and "today" depends on when the code is run. To fix this, you can specify a fixed reference date as a Date or string, for example: ```ts // creates a date soon after 2023-01-01