Skip to content

Calendar: display computed date range in header and align event list#678

Merged
multiplex55 merged 1 commit intomasterfrom
codex/compute-and-render-date-range-in-header
Jan 13, 2026
Merged

Calendar: display computed date range in header and align event list#678
multiplex55 merged 1 commit intomasterfrom
codex/compute-and-render-date-range-in-header

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Prevent a mismatch between the header label and the events shown by explicitly computing the visible date range per view mode.
  • Make the displayed range clear to users by showing start and end dates in the header.
  • Reuse the same range calculation for the header and the event list so they always match.
  • Ensure range_days is clamped to at least 1 when computing week ranges.

Description

  • Added a new helper date_range(&self, selected_date: NaiveDate) -> (NaiveDate, NaiveDate) that computes start/end for Day, Week (using range_days.max(1)), and Month (using add_months) modes.
  • Updated render_header() to compute the range and append a "YYYY-MM-DD → YYYY-MM-DD" label to the existing view text.
  • Updated render_event_list() to call date_range() and pass start_date/end_date to collect_events() so the list uses the same range as the header.
  • Removed duplicated range computation and consolidated logic into the shared helper in src/dashboard/widgets/calendar.rs.

Testing

  • No automated tests were run.

Codex Task

@multiplex55 multiplex55 merged commit cea19b9 into master Jan 13, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/compute-and-render-date-range-in-header branch January 14, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant