设置格式 React-Intl FormattedDate
Setting format React-Intl FormattedDate
FormattedDate 的默认格式在哪里设置?
现在我的日期显示的是月份的一位数:3/9/2017
格式化日期值={新日期('2017-03-09')}
可以在IntlProvider中设置吗?
您可以通过 format
属性设置格式:
props: DateTimeFormatOptions & {
value: any,
format?: string,
children?: (formattedDate: string) => ReactElement,
}
取自Docs
FormattedDate 的默认格式在哪里设置?
现在我的日期显示的是月份的一位数:3/9/2017
格式化日期值={新日期('2017-03-09')}
可以在IntlProvider中设置吗?
您可以通过 format
属性设置格式:
props: DateTimeFormatOptions & {
value: any,
format?: string,
children?: (formattedDate: string) => ReactElement,
}
取自Docs