Skip to content

Fix full-year total: 2016 hours, not 2088 - #7

Closed
CesarOrdazV wants to merge 1 commit into
mainfrom
cursor/fix-full-year-hours-fd0f
Closed

Fix full-year total: 2016 hours, not 2088#7
CesarOrdazV wants to merge 1 commit into
mainfrom
cursor/fix-full-year-hours-fd0f

Conversation

@CesarOrdazV

Copy link
Copy Markdown
Owner

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 HOLIDAYS list only works for years that were typed in; 2026 (and any later year) falls back to “weekdays only” until someone updates the list. Cached worktime.js on Pages can show the same 2088 after a holiday update.

Fix

  • Compute Mexican LFT holidays for each year in the selected range (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.
  • Regression test: 2026-01-012026-12-31 → 252 days / 2016:00, and 261 / 2088 only when holidays are explicitly empty.
  • Cache-bust worktime.js / app.js so Pages does not keep the old list.
  • Show the computed holiday dates for the start year in the page note.

Tests

node --test worktime.test.js

20 passing.

Open in Web Open in Cursor 

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>
@CesarOrdazV
CesarOrdazV deleted the cursor/fix-full-year-hours-fd0f branch August 26, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants