diff --git a/docs/examples/rtl.tsx b/docs/examples/rtl.tsx index 7077128fb..2fc307538 100644 --- a/docs/examples/rtl.tsx +++ b/docs/examples/rtl.tsx @@ -9,7 +9,7 @@ import enUS from '../../src/locale/en_US'; import jaJP from '../../src/locale/ja_JP'; import '../../assets/index.less'; -const defaultValue = moment('2019-11-28 01:02:03'); +const defaultValue = moment(); function formatDate(date: Moment | null) { return date ? date.format('YYYY-MM-DD HH:mm:ss') : 'null'; @@ -25,8 +25,9 @@ export default () => { }; const onChange = (newValue: Moment | null, formatString?: string) => { - console.log('Change:', newValue, formatString); - setValue(newValue); + const lastValue = Array.isArray(newValue) ? newValue[1] : newValue; + console.log('Change:', lastValue, newValue, formatString); + setValue(lastValue); }; const sharedProps = { @@ -206,7 +207,7 @@ export default () => { locale={zhCN} allowClear ref={rangePickerRef} - defaultValue={[moment('1990-09-03'), moment('1989-11-28')]} + defaultValue={[moment(), moment().add(1, 'M')]} placeholder={['start...', 'end...']} />