(Fix)Inconsistent Appointment Dates between Calendar and List View(03-5338 )#2190
(Fix)Inconsistent Appointment Dates between Calendar and List View(03-5338 )#2190bhavya-jpg wants to merge 1 commit intoopenmrs:mainfrom
Conversation
|
@bhavya-jpg could kindly look into the e2e test failure ? |
|
hi @gitcliff I investigated the E2E test failures in Isolation: My changes are strictly limited to useAppointmentsCalendar.ts, which is only used in the Calendar View. The failing test exercises the List View and Add/Edit forms, which use entirely different hooks (useAppointmentList) and do not invoke my modified code. can you please help me out in this |
|
Hey @bhavya-jpg! 😊 |
|
@ELVIS-KATO surely I will make the changes in the pr msg ,as per the conventional style of OpenMRS ,in the mean time can you please help me out with this E2E test error ,I am not able to figure out whats causing that actually . thank you |
|
From what I can see, the failing tests are all related to ward e2e scenarios, which are unrelated to the calendar changes you’ve worked on. These tests are known to be flaky at times, and addressing them is typically handled by the maintainers. Please don’t worry about these failures — they’re not caused by your changes. Your focus on the calendar ticket is exactly what’s needed here. |
|
@ELVIS-KATO thank you so much for the heads up about the E2E failure ,I am really relieved now ,I was really trying to figure out what was going wrong,and I have updated the pr also ,I think there wasnt any issue with the pr message itself as it follows the standard conventional template of PR message for OPENMRS ,I've changed the name of the pr to the jira issue ,as it was written in the PR conventions |
|
@bhavya-jpg Appreciate the update. One small thing—it would be great if the PR title started with a conventional prefix such as fix, feat, etc., based on the nature of the change. Everything else looks good, thanks! |
|
@ELVIS-KATO hey ,thanks for the review man ,i have made the change that you asked for hopefully everything looks good now |
|
@denniskigen, help me checkout this PR |
Requirements
Summary
This PR addresses a bug where appointments were appearing on inconsistent dates when comparing the Appointments Calendar (Monthly View) and the Appointments List (Daily View).
Problem:
The Calendar View relied on the
/appointment/appointmentSummaryendpoint, which aggregates counts based on UTC dates on the backend. However, the List View renders appointments in the user's local timezone. This caused visual discrepancies (e.g., an appointment at 11 PM UTC would show on "Jan 15" in the Calendar but "Jan 16" in the List for users in IST).Solution:
Refactored the [useAppointmentsCalendar] in openmrs-esm-patient-management/packages/esm-appointments-app/src/hooks/useAppointmentsCalendar.ts:6:0-65:2) hook to:
/appointments/searchendpoint (matching the List view's data source).dayjsto respect the user's local timezone.Screenshots
Related Issue##
https://openmrs.atlassian.net/browse/O3-5338
Other