Search code examples
reactjsdatetimereact-reduxreact-intl

Setting format React-Intl FormattedDate


Where does the default format get set for FormattedDate?

Right now my dates are showing the one digit for the month: 3/9/2017

FormattedDate value={new Date('2017-03-09')}

Can this be set in the IntlProvider?


Solution

  • You can set formatting via the format prop:

    props: DateTimeFormatOptions & {
        value: any,
        format?: string,
        children?: (formattedDate: string) => ReactElement,
    }
    

    Taken from the Docs