Skip to content

Commit

Permalink
Merge pull request #1673 from kajambiya/feat/useLocaledate
Browse files Browse the repository at this point in the history
OHRI-1896 Format date according to locale
  • Loading branch information
ODORA0 authored Nov 2, 2023
2 parents 24f3674 + 271f851 commit 1221879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/esm-commons-lib/src/utils/encounter-list-utils.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -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 (
Expand Down

0 comments on commit 1221879

Please sign in to comment.