DateFormatter
Sourceimport { DateFormatter } from "@prestojs/ui";
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:
Prop | Type | Description | |
---|---|---|---|
* | props An object with the properties below | ||
props.blankLabel | ReactNode | What to render when Defaults to | |
props.invalidDateLabel | ReactNode | What to render when passed date is invalid Defaults to | |
props.localeOptions | The localeOptions passed to Date.toLocaleDateString. | ||
props.locales | string|string[] | The locales option passed to Date.toLocaleDateString. | |
* | props.value | Date|string|null | The value to format |