我正在使用 react-dates,并且试图弄清楚如何将月份和工作日名称国际化。我已经想出了如何对输入占位符文本执行此操作,但我找不到如何执行此操作。
我给 react-dates 的当前道具DateRangePicker
如下所示:
<DateRangePicker
startDate={this.state.startDate} // momentPropTypes.momentObj or null,
endDate={this.state.endDate} // momentPropTypes.momentObj or null,
onDatesChange={({ startDate, endDate }) => {
this.setState({ startDate, endDate });
this.props.onDateChange(this.props.name, startDate, endDate);
}
} // PropTypes.func.isRequired,
focusedInput={this.state.focusedInput} // PropTypes.oneOf([START_DATE, END_DATE]) or null,
onFocusChange={focusedInput => this.setState({ focusedInput })} // PropTypes.func.isRequired,
numberOfMonths={1}
firstDayOfWeek={1}
minimumNights={0}
isOutsideRange={(x) => moment().add(1, 'days') < x }
displayFormat="DD-MM-YYYY"
showClearDates={true}
startDatePlaceholderText={this.props.intl.formatMessage({id: 'DATE_PICKER_START_DATE'})}
endDatePlaceholderText={this.props.intl.formatMessage({id: 'DATE_PICKER_END_DATE'})}
hideKeyboardShortcutsPanel= {true}
/>
我正在使用react-intl
国际化。
这是日历的样子: 日历的图像
基本上我要更改的是月份名称November
和工作日名称Mo Tu We Th Fr Sa Su
期望的结果是将它们翻译成芬兰语 ->Marraskuu
和Ma Ti Ke To Pe La Su