DateFormatter
This is a React component

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

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

ParameterTypeDescription
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
props.localesstring|Array

The locales option passed to Date.toLocaleDateString.

*props.valueDate|string|null

The value to format

Examples