Skip to content

Getting all ISO weeks for a year #226

Answered by BurntSushi
luc4hu asked this question in Q&A
Discussion options

You must be logged in to vote

I see this as similar to Date::days_in_month, so yeah, I'd be happy to have ISOWeekDate::weeks_in_year.

I mostly kept ISO 8601 week date support pretty bare bones because I was unclear on how broadly used it was. But I'm generally happy to beef up the ISOWeekDate type with more methods.

Another thing that would probably make this easier is adding an analog to Date::series, but for ISOWeekDate. Then you could do something like this: https://docs.rs/jiff/latest/jiff/civil/struct.Date.html#example-how-many-times-do-i-mow-the-lawn-in-a-year

And it probably makes sense to have ISOWeekDate::{first_of_week,last_of_week,first_of_year,last_of_year} as well. If you combine those with ISOWeekDate::s…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@luc4hu
Comment options

@BurntSushi
Comment options

@BurntSushi
Comment options

@BurntSushi
Comment options

Answer selected by luc4hu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants