Skip to main content

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

NameTypeDefault
date *
Date
locale
"tr" | "en" | "de" | "es" | "fr" | "ja" | "ko" | "pt" | "ru" | "vi" | "zh"
"en"
format
"date" | "dateCompact" | "dateTime" | "dateTimeCompact"
"date"
css
Add custom styles to this component. Use with caution. Learn more here: Link
SupportedStyleAttributes
inputFieldCss
SupportedStyleAttributes
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.
;