I have an application with react-intl injected. Its bilingual - in English and in Polish so i represent dates with . When I represent let's say 12 April 2005 its:
12.04.2005 in Polish
04/12/2005 in English
It confuses everyone as people think about the second date as 4th December. Can i somehow format dates so in English it would be DD/MM/YYYY ?
So, if the locale of your application is working fine, you can just use the FormattedDate component from react-intland it will display the date in the current format.
Assuming that the locale is in place, you'd only have to use it like this:
<FormattedDate
value="12.04.2005"
day="2-digit"
month="2-digit"
year="numeric"
/>
The FormattedDate component will use the locale of the application to format it to english or polish (or any other locale you set). Here is the reference in the doc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With