慕容森
class DateRangeWrapper extends React.PureComponent { render() { const { startDate, endDate, onDatesChange, focusedInput, onFocusChange, windowStyle, rangeSelect, blockpastDates, displayFormat, localelang, startDatePlaceholderText, endDatePlaceholderText, } = this.props; **moment.locale(`${localelang}`);** return ( <div className="CalendarComponent"> <div className={ windowStyle === 'Popup' ? windowStyle : classnames(windowStyle, 'inlineHeight') } > <DateRangePicker {...rangeConfig} startDate={rangeSelect === 'fromPresent' ? moment() : startDate} endDate={endDate} onDatesChange={onDatesChange} focusedInput={focusedInput} onFocusChange={onFocusChange} customArrowIcon={<ArrowIcon />} navPrev={<CalendarNavIcon direction="prev" />} navNext={<CalendarNavIcon direction="next" />} isOutsideRange={ blockpastDates ? day => moment().diff(day) > 0 : () => false } renderCalendarInfo={ windowStyle === 'Popup' ? () => ( <Controls applyText={this.props.applyText} cancelText={this.props.cancelText} onDatePickerApply={this.props.onDatePickerApply} onDatePickerClose={this.props.onDatePickerClose} /> ) : () => {} } displayFormat={displayFormat} startDatePlaceholderText={startDatePlaceholderText} endDatePlaceholderText={endDatePlaceholderText} /> </div> </div> ); }}localelang 是一个属性,其值为 i18next.language 从使用此日期组件的组件传递