docs: remove documentation about timezone

This commit is contained in:
Benjy Cui 2016-11-02 13:58:30 +08:00
parent 6e6970dbd5
commit 168370fb82
2 changed files with 4 additions and 14 deletions

View File

@ -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')} />
``` ```

View File

@ -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')} />
``` ```