DateTimeFormatter
This is a React component

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

Formats a date with 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 DateTimeField

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.toLocaleString.

*props.valueDate|string|null

The value to format

Examples