Skip to content

(feat) Improve appointments calendar with monthly, weekly, and daily drill-down views#2321

Open
Brijesh03032001 wants to merge 2 commits intoopenmrs:mainfrom
Brijesh03032001:feat/improved-appointments-calendar-view
Open

(feat) Improve appointments calendar with monthly, weekly, and daily drill-down views#2321
Brijesh03032001 wants to merge 2 commits intoopenmrs:mainfrom
Brijesh03032001:feat/improved-appointments-calendar-view

Conversation

@Brijesh03032001
Copy link

@Brijesh03032001 Brijesh03032001 commented Mar 14, 2026

Related Issue

https://issues.openmrs.org/browse/O3-5484

What I worked on

The appointments calendar wasn't very useful in its current state — it only showed a monthly grid with counts per service, and clicking a day would navigate you away from the calendar entirely. I worked on making it significantly more functional.

Here's what I added:

  • Three calendar views (Monthly, Weekly, Daily) — I added a content switcher in the calendar header so you can switch between views. The selected view is stored in the global store so it stays in sync.

  • Modal on click — Instead of navigating away when you click a day, I made it open a Carbon modal that shows all appointments for that day grouped by service. This keeps you in context.

  • Weekly view — I built a weekly grid showing all 7 days of the current week with service counts per day. You can navigate between weeks with Prev/Next buttons.

  • Daily view — I added a focused daily view with a full service breakdown table, a total count, a "Today" badge for the current date, and Prev/Next day navigation.

  • Tests — I wrote tests for all three new views, the calendar header switcher, and the weekDays/isSameMonth helper functions.

Notes for reviewers

  • I used Carbon's ContentSwitcher for the view tabs — happy to change this if there's a preferred approach.
  • @internationalized/date support for non-Gregorian calendars is not in this PR yet — I plan to tackle that as a follow-up.
  • The 3 failing tests in appointments-form.test.tsx are pre-existing and unrelated to this PR.

Screenshots

Screenshot 2026-03-13 at 17 57 12 Screenshot 2026-03-13 at 17 56 57 Screenshot 2026-03-13 at 17 57 03

Brijesh03032001 and others added 2 commits March 13, 2026 18:01
…ments calendar

The calendar was only showing a monthly overview before, with no way to get
a closer look at specific weeks or days. This adds weekly and daily views that
you can switch between using a tab switcher in the header.

Clicking on a day now opens a modal showing all the appointments for that day,
grouped by service — so you no longer get redirected away from the calendar.

Changes include:
- Monthly/weekly/daily view switcher in the calendar header
- New WeeklyCalendarView and DailyCalendarView components
- Day cells and service rows open a Carbon Modal on click (no navigation)
- weekDays() helper added for weekly view grid
- calendarView state added to the appointments store
- Tests for the new views, header switcher, and helper functions
Added missing i18n keys for the daily, weekly and monthly views —
things like navigation labels, modal text, and empty state messages.

Co-Authored-By: Brijesh Kumar <brijeshkumar03@users.noreply.github.com>
@Brijesh03032001 Brijesh03032001 force-pushed the feat/improved-appointments-calendar-view branch from 72c0f51 to e6d5617 Compare March 14, 2026 01:04
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