mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
docs: remove documentation about timezone
This commit is contained in:
parent
6e6970dbd5
commit
168370fb82
@ -15,17 +15,12 @@ By clicking the input box, you can select a date from a popup calendar.
|
|||||||
Note: Part of locale of DatePicker, MonthPicker, RangePicker is read from value. So, please set the locale of moment correctly.
|
Note: Part of locale of DatePicker, MonthPicker, RangePicker is read from value. So, please set the locale of moment correctly.
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import moment from 'moment-timezone/moment-timezone';
|
import moment from 'moment';
|
||||||
|
|
||||||
// It's recommended to set locale and timezone in entry file globaly.
|
// It's recommended to set locale in entry file globaly.
|
||||||
import 'moment/locale/zh-cn';
|
import 'moment/locale/zh-cn';
|
||||||
moment.locale('zh-cn');
|
moment.locale('zh-cn');
|
||||||
|
|
||||||
// Set timezone if you need it.
|
|
||||||
// The following data is copied from https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json
|
|
||||||
moment.tz.add('Asia/Shanghai|CST CDT|-80 -90|01010101010101010|-1c1I0 LX0 16p0 1jz0 1Myp0 Rb0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6');
|
|
||||||
moment.tz.setDefault('Asia/Shanghai')
|
|
||||||
|
|
||||||
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />
|
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -16,17 +16,12 @@ subtitle: 日期选择框
|
|||||||
注意:DatePicker、MonthPicker、RangePicker 部分 locale 是从 value 中读取,所以请先正确设置 moment 的 locale。
|
注意:DatePicker、MonthPicker、RangePicker 部分 locale 是从 value 中读取,所以请先正确设置 moment 的 locale。
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
import moment from 'moment-timezone/moment-timezone';
|
import moment from 'moment';
|
||||||
|
|
||||||
// 推荐在入口文件全局设置 locale 与时区
|
// 推荐在入口文件全局设置 locale
|
||||||
import 'moment/locale/zh-cn';
|
import 'moment/locale/zh-cn';
|
||||||
moment.locale('zh-cn');
|
moment.locale('zh-cn');
|
||||||
|
|
||||||
// 按需设置时区
|
|
||||||
// 从 https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json 复制
|
|
||||||
moment.tz.add('Asia/Shanghai|CST CDT|-80 -90|01010101010101010|-1c1I0 LX0 16p0 1jz0 1Myp0 Rb0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6');
|
|
||||||
moment.tz.setDefault('Asia/Shanghai')
|
|
||||||
|
|
||||||
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />
|
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user