Fix full-year total: 2016 hours, not 2088 - #7
Closed
CesarOrdazV wants to merge 1 commit into
Closed
Conversation
2088 is 261 weekdays × 8 with no holidays subtracted. Generate LFT holidays (plus Holy Thursday/Friday) for each year in the range so a calendar year is 252 working days / 2016 hours. Add a regression test for that total and cache-bust the scripts. Co-authored-by: César Ordaz <cesar.ordazv@gmail.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.
Problem
For a full calendar year the expected total should be 2016 hours (252 working days × 8). The calculator was producing 2088 hours (261 weekdays × 8) — weekends removed, holidays not subtracted.
That is exactly 9 weekday holidays missing. A static
HOLIDAYSlist only works for years that were typed in; 2026 (and any later year) falls back to “weekdays only” until someone updates the list. Cachedworktime.json Pages can show the same 2088 after a holiday update.Fix
holidaysForYear): 1 Jan, first Monday of February, third Monday of March, 1 May, 16 Sep, third Monday of November, 25 Dec, plus Holy Thursday and Good Friday from Easter.2026-01-01…2026-12-31→ 252 days / 2016:00, and 261 / 2088 only when holidays are explicitly empty.worktime.js/app.jsso Pages does not keep the old list.Tests
20 passing.