Skip to main content

core.formatdate

Home > @medplum/core > formatDate

formatDate() function

Formats a FHIR date string as a human readable string. Handles missing values and invalid dates.

Signature:

export declare function formatDate(date: string | undefined, locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;

Parameters

Parameter

Type

Description

date

string | undefined

The date to format.

locales

Intl.LocalesArgument

(Optional) Optional locales.

options

Intl.DateTimeFormatOptions | undefined

(Optional) Optional date format options.

Returns:

string

The formatted date string.