[timesheets] Fix week list truncation at the ISO year boundary#2103
Open
frankrousseau wants to merge 1 commit into
Open
[timesheets] Fix week list truncation at the ISO year boundary#2103frankrousseau wants to merge 1 commit into
frankrousseau wants to merge 1 commit into
Conversation
In the last days of December, moment().week() already returns 1 (the locale week of the next year), so the weekly timesheet collapsed to a single wrong column for the whole year (cgwire#1928). getWeekRange now uses isoWeek()/isoWeekYear(), matching the backend which keys the week table with date.isocalendar(), and falls back to the full year range when today's ISO week belongs to another year. Align the other week computations of the timesheet pages on the same ISO convention: the header tooltip used today's year instead of the displayed one, and the side panel derived the week interval from locale weeks, showing a range shifted from the one the backend aggregates for years starting on Friday or Saturday. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
getWeekRangeusedmoment().week(), which already returns 1 for late-December days.isocalendar/isoweek) actually aggregates.Solutions
getWeekRangenow usesisoWeek()/isoWeekYear()and only truncates the range at the current week when today's ISO week belongs to the displayed year, otherwise it lists the full 52/53-week range.