x <- year_week_day(2019:2020, 5, 6, 10)
x
# Compute the last moment of the last week of the year
calendar_end(x, "year")
# Compare that to just setting the week to `"last"`,
# which doesn't affect the other components
set_week(x, "last")
Run the code above in your browser using DataLab