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

date.anytime #2093

Closed
Shinigami92 opened this issue Apr 25, 2023 · 7 comments · Fixed by #2096
Closed

date.anytime #2093

Shinigami92 opened this issue Apr 25, 2023 · 7 comments · Fixed by #2096
Assignees
Labels
c: bug Something isn't working p: 2-high Fix main branch

Comments

@Shinigami92
Copy link
Member

Due to a requested reviews to use between instead of its own function, it slipped into the next branch that we dont have a method anymore that just provides a random date but without arguments/parameters
We need to fix that before releasing v8.0

#2053 (comment)

@ST-DDT suggested to add a date.anytime for that

@Shinigami92 Shinigami92 added c: bug Something isn't working p: 2-high Fix main branch labels Apr 25, 2023
@Shinigami92 Shinigami92 moved this to Todo in Faker Roadmap Apr 25, 2023
@xDivisionByZerox
Copy link
Member

Usually, we called those methods, that simply return "any" module-related value, sample.

Examples:

@matthewmayer
Copy link
Contributor

date.whenever

@ST-DDT
Copy link
Member

ST-DDT commented Apr 25, 2023

The idea behind anytime is using it with optional options.
anytime({ past: { days: 1}, future: { days: 42 } })

@matthewmayer
Copy link
Contributor

matthewmayer commented Apr 25, 2023

faker.helpers.arrayElement([faker.date.past(), faker.date.future()])

@Shinigami92
Copy link
Member Author

The idea behind anytime is using it with optional options. anytime({ past: { days: 1}, future: { days: 42 } })

In the first step, I would suggest to use date.anytime() or date.between()
Then in v8.1+ we can introduce params to date.anytime({ ... }) and move on from that

So for now we just "fix" the "there is no non-args date method"

Because we want to release (at least rc.0) end of this week 👀

@matthewmayer
Copy link
Contributor

could this just be solved by adding defaults to the from and to parameters for between?

@ST-DDT
Copy link
Member

ST-DDT commented Apr 25, 2023

could this just be solved by adding defaults to the from and to parameters for between?

Theoretically yes, but from the method name you expect it to require parameters.

@Shinigami92 Shinigami92 linked a pull request Apr 25, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from Todo to Done in Faker Roadmap Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working p: 2-high Fix main branch
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants