Date Localization
The Date Localization is for a consistent date formatting.
You can use both DateLocalization
component and useDateLocalization
hook to get formatted date.
To see all different date formats with different locales please check Internationalization.
Example
Live Editor
Result
Loading...
Example using custom hook
You need to pass the date
, locale
and format
to the useDateLocalization
hook like this example:
Live Editor
Result
Loading...
Props
Name | Type | Default |
---|---|---|
date * |
| — |
locale |
| "en" |
format |
| "date" |
css Add custom styles to this component. Use with caution. Learn more here: Link |
| — |
inputFieldCss |
| — |
data-{foo} Data attributes can be used by testing libraries to retrieve components or assert their existence |
| — |
* - the prop is required. |