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

ParameterTypeDescription
datestring | undefinedThe date to format.
localesIntl.LocalesArgument(Optional) Optional locales.
optionsIntl.DateTimeFormatOptions | undefined(Optional) Optional date format options.

Returns:

string

The formatted date string.