diff options
| author | ST-DDT <[email protected]> | 2024-03-24 13:51:49 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-24 12:51:49 +0000 |
| commit | 3485e7eece540b63059e97bd8166d1ffd88334de (patch) | |
| tree | 08474cb5729326a5966f0cda33221c3179f6ddc4 /docs | |
| parent | 45150d1ed6d5ce03d0468b938bb5ce4962476966 (diff) | |
| download | faker-3485e7eece540b63059e97bd8166d1ffd88334de.tar.xz faker-3485e7eece540b63059e97bd8166d1ffd88334de.zip | |
refactor(date)!: fail on invalid dates (#2757)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/guide/upgrading_v9/2757.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/guide/upgrading_v9/2757.md b/docs/guide/upgrading_v9/2757.md new file mode 100644 index 00000000..c7a79577 --- /dev/null +++ b/docs/guide/upgrading_v9/2757.md @@ -0,0 +1,9 @@ +### Fail on invalid dates + +Various methods in the `faker.date` module allow you to pass a `Date`-ish value: +that is, either a Javascript Date, or a timestamp number or string that can be converted to a `Date` via the `new Date()` constructor. + +Previously, if you passed something which could not be parsed to a `Date`, it would fall back to the current reference date. +Now, this throws an error raising awareness of that bad value. + +This affects the `refDate` parameter of the `anytime()`, `birthdate()`, `past()`, `future()`, `recent()` and `soon()`, methods as well as the `from` and `to` parameters of `between()` and `betweens()`. |
