Skip to content

Year-based navigation for arrows and Today - #2

Merged
alontu merged 1 commit into
masterfrom
feat/year-navigation
Jun 11, 2026
Merged

Year-based navigation for arrows and Today#2
alontu merged 1 commit into
masterfrom
feat/year-navigation

Conversation

@alontu

@alontu alontu commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Problem

The < / > arrows shifted the current start/end window by a year (addYears), so any non-calendar-year view (e.g. after the date-range picker) stayed >12 months and slid sideways instead of snapping to a year.

Change

  • < / > → navigate to year ± 1, always a clean Jan..Dec (12 months) via the year param.
  • Today → goes to the current calendar year (scrolls to today if already on it).
  • The custom date-range picker still allows arbitrary multi-month ranges.
  • Extracted resolveRange/yearRange to src/lib/calendar-range.ts (used by page.tsx) with tests; removed dead imports.

Verification

  • npm test → 69 passing (incl. new calendar-range tests + the "arrow stays 12 months" invariant)
  • npm run build → green
  • Visual: a year renders exactly 12 month rows (Jan→Dec), title "שנה YYYY"

🤖 Generated with Claude Code

The < / > arrows previously shifted the current start/end window by a year
with addYears, so any non-calendar-year view (e.g. after using the date-range
picker) stayed >12 months and just slid sideways.

Now the arrows navigate to year ± 1 (always a clean Jan..Dec view via the
`year` param), and "Today" goes to the current calendar year (scrolling to
today if already on it). The custom date-range picker still allows arbitrary
multi-month ranges.

Extracted resolveRange/yearRange into src/lib/calendar-range.ts (used by
page.tsx) with tests; removed dead imports (getYearRangeDates, redirect, unused
date-fns).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alontu
alontu merged commit 924d603 into master Jun 11, 2026
1 check passed
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