diff --git a/packages/esm-active-visits-app/src/visits-summary/visit-detail.test.tsx b/packages/esm-active-visits-app/src/visits-summary/visit-detail.test.tsx index 314c020e0..19a373103 100644 --- a/packages/esm-active-visits-app/src/visits-summary/visit-detail.test.tsx +++ b/packages/esm-active-visits-app/src/visits-summary/visit-detail.test.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { render, screen, act } from '@testing-library/react'; import VisitDetailComponent from './visit-detail.component'; import { useVisit } from './visit.resource'; +import { formatDate } from '@openmrs/esm-framework'; jest.mock('./visit.resource'); @@ -23,11 +24,12 @@ describe('VisitDetailComponent', () => { }); it('should render visit details and switches when data is available', () => { + let visitDate = new Date(); mockedUseVisit.mockReturnValueOnce({ visit: { uuid: visitUuid, visitType: { display: 'Some Visit Type' }, - startDatetime: '2023-07-29T12:34:56Z', + startDatetime: visitDate, encounters: [], }, isLoading: false, @@ -36,7 +38,7 @@ describe('VisitDetailComponent', () => { render(); expect(screen.getByText(/Some Visit Type/)).toBeInTheDocument(); - expect(screen.getByText(/29-Jul-2023, 12:34 PM/)).toBeInTheDocument(); + expect(screen.getByText(formatDate(visitDate))).toBeInTheDocument(); expect(screen.getByText('All Encounters')).toBeInTheDocument(); expect(screen.getByText('Visit Summary')).toBeInTheDocument(); diff --git a/packages/esm-appointments-app/src/appointments/details/appointment-details.component.tsx b/packages/esm-appointments-app/src/appointments/details/appointment-details.component.tsx index 9d52c4b50..9abcbb014 100644 --- a/packages/esm-appointments-app/src/appointments/details/appointment-details.component.tsx +++ b/packages/esm-appointments-app/src/appointments/details/appointment-details.component.tsx @@ -63,7 +63,7 @@ const AppointmentDetails: React.FC = ({ appointment }) {appointmentsCount.cancelledAppointments}
-

{t('upcomming', 'Upcoming')}

+

{t('upcoming', 'Upcoming')}

{appointmentsCount.upcomingAppointments}
diff --git a/packages/esm-appointments-app/src/patient-queue/visit-form/queue.resource.ts b/packages/esm-appointments-app/src/patient-queue/visit-form/queue.resource.ts index 1d26d5388..56aabaef9 100644 --- a/packages/esm-appointments-app/src/patient-queue/visit-form/queue.resource.ts +++ b/packages/esm-appointments-app/src/patient-queue/visit-form/queue.resource.ts @@ -36,7 +36,7 @@ export async function saveQueueEntry( patient: { uuid: patientUuid, }, - startedAt: toDateObjectStrict(toOmrsIsoString(new Date())), + startedAt: new Date(), sortWeight: sortWeight, }, }, diff --git a/packages/esm-appointments-app/src/patient-queue/visit-form/visit-form.component.tsx b/packages/esm-appointments-app/src/patient-queue/visit-form/visit-form.component.tsx index 627e00620..91fb57adb 100644 --- a/packages/esm-appointments-app/src/patient-queue/visit-form/visit-form.component.tsx +++ b/packages/esm-appointments-app/src/patient-queue/visit-form/visit-form.component.tsx @@ -98,10 +98,12 @@ const VisitForm: React.FC = ({ patientUuid, appointment }) => { const payload: NewVisitPayload = { patient: patientUuid, - startDatetime: toDateObjectStrict( - toOmrsIsoString( - new Date(dayjs(visitDate).year(), dayjs(visitDate).month(), dayjs(visitDate).date(), hours, minutes), - ), + startDatetime: new Date( + dayjs(visitDate).year(), + dayjs(visitDate).month(), + dayjs(visitDate).date(), + hours, + minutes, ), visitType: visitType, location: selectedLocation, diff --git a/packages/esm-appointments-app/translations/am.json b/packages/esm-appointments-app/translations/am.json index e53ac77e4..5232eff1e 100644 --- a/packages/esm-appointments-app/translations/am.json +++ b/packages/esm-appointments-app/translations/am.json @@ -136,7 +136,7 @@ "unscheduled": "Unscheduled", "unscheduledAppointments": "Unscheduled appointments", "unscheduledAppointments_lower": "unscheduled appointments", - "upcomming": "Upcoming", + "upcoming": "Upcoming", "view": "View", "viewCalendar": "View Calendar", "visitLocation": "Visit Location", diff --git a/packages/esm-appointments-app/translations/en.json b/packages/esm-appointments-app/translations/en.json index 5c8ae3634..37fcf1e2f 100644 --- a/packages/esm-appointments-app/translations/en.json +++ b/packages/esm-appointments-app/translations/en.json @@ -136,7 +136,7 @@ "unscheduled": "Unscheduled", "unscheduledAppointments": "Unscheduled appointments", "unscheduledAppointments_lower": "unscheduled appointments", - "upcomming": "Upcoming", + "upcoming": "Upcoming", "view": "View", "viewCalendar": "View Calendar", "visitLocation": "Visit Location", diff --git a/packages/esm-appointments-app/translations/fr.json b/packages/esm-appointments-app/translations/fr.json index e53ac77e4..5232eff1e 100644 --- a/packages/esm-appointments-app/translations/fr.json +++ b/packages/esm-appointments-app/translations/fr.json @@ -136,7 +136,7 @@ "unscheduled": "Unscheduled", "unscheduledAppointments": "Unscheduled appointments", "unscheduledAppointments_lower": "unscheduled appointments", - "upcomming": "Upcoming", + "upcoming": "Upcoming", "view": "View", "viewCalendar": "View Calendar", "visitLocation": "Visit Location", diff --git a/packages/esm-appointments-app/translations/he.json b/packages/esm-appointments-app/translations/he.json index 2c040c7b5..d025adf30 100644 --- a/packages/esm-appointments-app/translations/he.json +++ b/packages/esm-appointments-app/translations/he.json @@ -136,7 +136,7 @@ "unscheduled": "Unscheduled", "unscheduledAppointments": "Unscheduled appointments", "unscheduledAppointments_lower": "unscheduled appointments", - "upcomming": "Upcoming", + "upcoming": "Upcoming", "view": "הצג", "viewCalendar": "הצג לוח שנה", "visitLocation": "מיקום הביקור", diff --git a/packages/esm-appointments-app/translations/km.json b/packages/esm-appointments-app/translations/km.json index b911e6687..e136f7959 100644 --- a/packages/esm-appointments-app/translations/km.json +++ b/packages/esm-appointments-app/translations/km.json @@ -136,7 +136,7 @@ "unscheduled": "មិនបានគ្រោងទុក", "unscheduledAppointments": "ការណាត់ជួបដែលមិនបានគ្រោងទុក", "unscheduledAppointments_lower": "unscheduled appointments", - "upcomming": "Upcoming", + "upcoming": "Upcoming", "view": "ពិនិត្យមើល", "viewCalendar": "ពិនិត្យមើលប្រតិទិន", "visitLocation": "ទីតាំងមកពិនិត្យ", diff --git a/packages/esm-service-queues-app/src/active-visits/active-visits-table.resource.ts b/packages/esm-service-queues-app/src/active-visits/active-visits-table.resource.ts index 973f1558c..68a79faa1 100644 --- a/packages/esm-service-queues-app/src/active-visits/active-visits-table.resource.ts +++ b/packages/esm-service-queues-app/src/active-visits/active-visits-table.resource.ts @@ -311,7 +311,7 @@ export async function updateQueueEntry( patient: { uuid: patientUuid, }, - startedAt: toDateObjectStrict(toOmrsIsoString(new Date())), + startedAt: new Date(), sortWeight: sortWeight, queueComingFrom: previousQueueUuid, }, @@ -396,7 +396,7 @@ export async function addQueueEntry( patient: { uuid: patientUuid, }, - startedAt: toDateObjectStrict(toOmrsIsoString(new Date())), + startedAt: new Date(), sortWeight: sortWeight, }, }, diff --git a/packages/esm-service-queues-app/src/active-visits/change-status-dialog.component.tsx b/packages/esm-service-queues-app/src/active-visits/change-status-dialog.component.tsx index 257e7ad43..289767c5a 100644 --- a/packages/esm-service-queues-app/src/active-visits/change-status-dialog.component.tsx +++ b/packages/esm-service-queues-app/src/active-visits/change-status-dialog.component.tsx @@ -62,7 +62,7 @@ const ChangeStatus: React.FC = ({ queueEntry, closeModa const queuePriority = priority === '' ? defaultPriority : priority; const emergencyPriorityConceptUuid = config.concepts.emergencyPriorityConceptUuid; const sortWeight = priority === emergencyPriorityConceptUuid ? 1.0 : 0.0; - const endDate = toDateObjectStrict(toOmrsIsoString(new Date())); + const endDate = new Date(); updateQueueEntry( queueEntry?.visitUuid, queueEntry?.queueUuid, diff --git a/packages/esm-service-queues-app/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.tsx b/packages/esm-service-queues-app/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.tsx index 90d74a968..fb9bab760 100644 --- a/packages/esm-service-queues-app/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.tsx +++ b/packages/esm-service-queues-app/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.tsx @@ -11,7 +11,7 @@ export async function batchClearQueueEntries(queueEntries: Array = ({ queueEn stopDatetime: new Date(), }; - const endedAt = toDateObjectStrict(toOmrsIsoString(new Date())); + const endedAt = new Date(); voidQueueEntry( queueEntry.queueUuid, diff --git a/packages/esm-service-queues-app/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx b/packages/esm-service-queues-app/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx index c42731abb..17b0054bd 100644 --- a/packages/esm-service-queues-app/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +++ b/packages/esm-service-queues-app/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx @@ -53,7 +53,7 @@ const TransitionQueueEntryModal: React.FC = ({ q const { mutate } = useVisitQueueEntries('', ''); const launchEditPriorityModal = useCallback(() => { - const endedAt = toDateObjectStrict(toOmrsIsoString(new Date())); + const endedAt = new Date(); updateQueueEntry( queueEntry?.visitUuid, queueEntry?.queueUuid,