From 271f85125ad7a3f613ff57a7ff17e90e1533b130 Mon Sep 17 00:00:00 2001 From: kajambiya Date: Tue, 31 Oct 2023 08:33:37 +0300 Subject: [PATCH] format date according to locale --- packages/esm-commons-lib/src/utils/encounter-list-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/esm-commons-lib/src/utils/encounter-list-utils.ts b/packages/esm-commons-lib/src/utils/encounter-list-utils.ts index cace4fd9d..1ca51bfe0 100644 --- a/packages/esm-commons-lib/src/utils/encounter-list-utils.ts +++ b/packages/esm-commons-lib/src/utils/encounter-list-utils.ts @@ -1,5 +1,5 @@ import moment from 'moment'; -import { openmrsFetch } from '@openmrs/esm-framework'; +import { formatDate, openmrsFetch, parseDate } from '@openmrs/esm-framework'; import { launchFormWithCustomTitle } from './ohri-forms-commons'; export function getEncounterValues(encounter, param: string, isDate?: Boolean) { @@ -43,7 +43,7 @@ export function getObsFromEncounter(encounter, obsConcept, isDate?: Boolean, isT return '--'; } if (isDate) { - return moment(obs.value).format('DD-MMM-YYYY'); + return formatDate(parseDate(obs.value),{mode: 'wide'}) } if (typeof obs.value === 'object' && obs.value?.names) { return (