React Intl Date Format to get specific date format

781 views Asked by At

I am using React Intl Date formating API's

https://github.com/formatjs/react-intl/blob/master/docs/API.md#date-formatting-apis

I wanted to have the date in this format

August 7, 2019

Basically the Intl date does not have the following format. This is what i have tried

<FormattedDate
  year: 'numeric',
  day: '2-digit',
  month: 'long',
/>

How do i get this format - August 7, 2019 format to use in the React Intl Formatted Date API

1

There are 1 answers

0
reachtokish On

You can do something like this

<FormattedDate
  value={new Date()}
  year="numeric"
  month="long"
  day="2-digit"
/>