feat(date): add ability to provide year range for past and future#3783
feat(date): add ability to provide year range for past and future#3783
past and future#3783Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #3783 +/- ##
=======================================
Coverage 98.89% 98.89%
=======================================
Files 888 888
Lines 3065 3077 +12
Branches 556 546 -10
=======================================
+ Hits 3031 3043 +12
Misses 30 30
Partials 4 4
🚀 New features to boost your workflow:
|
ST-DDT
left a comment
There was a problem hiding this comment.
We should apply the adjustments to recent and soon as well.
As I said in the PR description, I would suggest providing an additional PR for this. Alternatively, the PR title could be extended even further. |
Sorry, have missed that part of the description. Separate PR would be more clear. |
Description
This PR fixes #3653.
Changes
yearsargument indate.past()anddate.future()to be able to provide a rangeyear.maxmust be greater thanyears.min- this will be enforced bydate.between()(the underlying implementation) as well, but I added an additional check to give a nicer error messagethrowtags to the JSDocs of the functions - these where previously missing even tho the functions were able to throwdate.futurewith the one fromdate.pastsince they were more strictNote
I quite enjoyed implementing an actual feature again. I would go ahead and implement the same feature for
date.recentanddate.soonin a separate PR if the team allows it.Links