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
Get week start and end days #654
Comments
Can you talk more about the use case, what you are trying to achieve that is harder with the current API than (you think) it should be? There are any number of ways we could go about this, but you're describing potential solutions more than the problem you started out with. |
Sure let me provide more context, when it comes down to reports it is quite common to collect data within a date range such as weekly, monthly, quarterly, or yearly, therefore, getting week boundaries based on a specific date could be useful, in fact, that is the main reason why I came out with this proposal since right now I'm pulling data from an API that takes
I would say the current API is very polished and coming up with a solution for the use case described above was not difficult, but at the same time, it feels like a common use case which is why I made this proposal. I hope this extra context provides more insights about the problem. Thank you for reviewing this proposal. |
Okay, it makes sense to me to add Can you submit a PR including some tests? |
Sure, I'm planning to work on this next week |
Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com> Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com> Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com> Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com> Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Co-authored-by: David Mazarro <dmunuera@stackbuilders.com> Co-authored-by: Jorge Guerra <jguerra@stackbuilders.com>
Inspired by Rails DateAndTime::Calculations module, it would be useful to have a set of functions that return week boundaries based on a weekday. This proposal - if approved - intends to add the following functions to
IsoWeek
implementation:Equivalent to Rails beginning_of_week.
Equivalent to Rails end_of_week.
Additionally, a function that returns the start and end of the week at once could be added as well:
Usage
A common use case would be getting the week boundaries based on a day:
The text was updated successfully, but these errors were encountered: