Open
Description
AFAIK there's currently no function to calculate the starting date of a week for a given year. I've stumbled across https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878/11 that provides a solution.
Based on that discussion, I propose the following addition to Dates:
function firstdayofISOyear(x)
firstday = firstdayofweek(firstdayofyear(x))
week(firstday) == 1 ? firstday : firstday + Day(7)
end
firstdayofISOyear(x::Integer) = firstdayofISOyear(Date(Year(x)))
firstdayofISOweek(year, week::Integer) = firstdayofISOyear(year) + Day(7(week - 1))
# or alternatively add a two-argument method to `firstdayofweek()`
firstdayofweek(year, week::Integer) = firstdayofISOyear(year) + Day(7(week - 1))
would be interested in knowing what you think.