Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(date): add hints how to generate date ranges #3128

Merged
merged 8 commits into from
Oct 20, 2024
5 changes: 5 additions & 0 deletions src/modules/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,11 @@ export class SimpleDateModule extends SimpleModuleBase {
*
* For more control, any of these methods can be customized with further options, or use [`between()`](https://fakerjs.dev/api/date.html#between) to generate a single date between two dates, or [`betweens()`](https://fakerjs.dev/api/date.html#betweens) for multiple dates.
*
* If you need to generate a date range (start-end), you can do so using either of these two methods:
*
* - `const [start, end] = faker.date.betweens({ from, to, count: 2 });`
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
* - `const start = faker.date.soon(); const end = faker.date.soon({ refDate: start });`
*
* Dates can be specified as Javascript Date objects, strings or UNIX timestamps.
* For example to generate a date between 1st January 2000 and now, use:
* ```ts
Expand Down