DateFormatOptions

Settings for the formatDate and parseDate functions.

NameTypeDefaultDescription

date?

"long" | "short" | "medium" | "full"

Specifies which of the locale dateFormats will be used to format the value.

datetime?

"long" | "short" | "medium" | "full"

Specifies which of the locale dateTimeFormats will be used to format the value.

day?

"numeric" | "2-digit"

Specifies how the day of the month will be formatted.

era?

"long" | "short" | "narrow"

Specifies how the date era will be formatted.

hour?

"numeric" | "2-digit"

Specifies how the hours will be formatted.

hour12?

boolean

Specifies whether a 12-hour time-set will be used for the formatting.

minute?

"numeric" | "2-digit"

Specifies how the minutes will be formatted.

month?

"long" | "short" | "narrow" | "numeric" | "2-digit"

Specifies how the date month will be formatted.

pattern?

string

Defines the exact pattern that will be used to format the date.

second?

"numeric" | "2-digit"

Specifies how the seconds will be formatted.

skeleton?

string

Defines the skeleton format that is used to get the pattern from the availableFormats of the locale calendar.

time?

"long" | "short" | "medium" | "full"

Specifies which of the locale timeFormats will be used to format the value.

timeZoneName?

"long" | "short"

Specifies how the time-zone will be formatted.

weekday?

"long" | "short" | "narrow"

Specifies how the day of the week will be formatted.

year?

"numeric" | "2-digit"

Specifies how the date year will be formatted.