Skip to content

Default the date picker to local time and match the pipeline's non-leap day-of-year#10

Merged
tylerpearson merged 1 commit into
mainfrom
advisor/004-local-date-doy
Jul 1, 2026
Merged

Default the date picker to local time and match the pipeline's non-leap day-of-year#10
tylerpearson merged 1 commit into
mainfrom
advisor/004-local-date-doy

Conversation

@tylerpearson

Copy link
Copy Markdown
Owner

Executes plans/004-local-date-and-doy-alignment.md. Advisor-reviewed: diff read, tests audited and re-run (28 vitest + 25 pytest).

  • Date picker no longer defaults to tomorrow after ~5pm Pacific (toISOString → local date)
  • dayOfYear now uses the pipeline's non-leap _MONTH_START convention, so seasonal boundaries stop drifting a day in leap years and windows ending 12/31 stay open on Dec 31, 2028
  • Marked characterization test flipped per plan; Feb-29→Mar-1 and cross-convention anchors added

🤖 Generated with Claude Code

https://claude.ai/code/session_01HNxgKNjtfeKtxYvN34KbGs

…ap day-of-year

The date input defaulted to the UTC date via toISOString(), so after ~4-5pm
Pacific the picker started on tomorrow -- exactly the evening hours the
product's primary use case (night-before/trailhead planning) depends on.
Separately, dayOfYear() counted real calendar days (366 in leap years) while
pipeline/normalize.py encodes season windows with a fixed non-leap month
table, so leap-year dates after Feb 28 compared one day high and a window
ending 12/31 read closed on Dec 31 of a leap year (next occurrence: 2028).

Rewrite dayOfYear() to use the same non-leap MONTH_START table as the
pipeline, default the date input from local Y-M-D fields instead of
toISOString(), and update legal.test.ts to lock in the corrected convention.
@tylerpearson tylerpearson merged commit 3dfa07f into main Jul 1, 2026
2 of 3 checks passed
@tylerpearson tylerpearson deleted the advisor/004-local-date-doy branch July 1, 2026 22:18
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.

1 participant