DateFormatter

Source
import { DateFormatter } from "@prestojs/ui";
DateFormatter(props)
Source

Formats a date without time based on user browser's locale.

If no value is provided blankLabel is returned.

If an invalid date is provided invalidDateLabel is returned.

This is the default formatter used for DateField

Component Props:

PropTypeDescription
*
props
An object with the properties below
props.blankLabelReactNode

What to render when value is null, undefined or an empty string

Defaults to null

props.invalidDateLabelReactNode

What to render when passed date is invalid

Defaults to null

props.localeOptions

The localeOptions passed to Date.toLocaleDateString.

props.localesstring|string[]

The locales option passed to Date.toLocaleDateString.

*props.valueDate|string|null

The value to format

Examples

basic