Browse Source

docs: update change log

pull/3423/head
Benjy Cui 8 years ago
parent
commit
e7e22602ef
  1. 5
      CHANGELOG.en-US.md
  2. 5
      CHANGELOG.zh-CN.md

5
CHANGELOG.en-US.md

@ -58,10 +58,7 @@ There are some breaking changes in `antd@2.0.0`, and you need to modify your cod
- <Calendar defaultValue={new Date('2010-10-10')} /> - <Calendar defaultValue={new Date('2010-10-10')} />
+ <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} /> + <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} />
``` ```
* Parameters of type `Date/GregorianCalendar` of functions such as `onChange` and `onPanelChange`, plus other callback functions had been changed to type moment. Please consult [APIs of gregorian-calendar](https://github.com/yiminghe/gregorian-calendar) and [APIs of moment](http://momentjs.com/docs/), and update your code accordingly. And the difference between GregorianCalendar's and moment's APIs(not a completed list): * Parameters of type `Date/GregorianCalendar` of functions such as `onChange` and `onPanelChange`, plus other callback functions had been changed to type moment. Please consult [APIs of gregorian-calendar](https://github.com/yiminghe/gregorian-calendar) and [APIs of moment](http://momentjs.com/docs/), and update your code accordingly. And you can consult this [commit](https://github.com/ant-design/ant-design/commit/5a4ebe535f0353089b30ac331bc4fb7877963371) to see how to upate.
```jsx
time.getTime() => time.valueOf();
```
Because the return value of `JSON.stringy(date: moment)` will lost time zone, we should use `.format` to convert date to string first, see related issue [#3082](https://github.com/ant-design/ant-design/issues/3082) for details: Because the return value of `JSON.stringy(date: moment)` will lost time zone, we should use `.format` to convert date to string first, see related issue [#3082](https://github.com/ant-design/ant-design/issues/3082) for details:
```js ```js

5
CHANGELOG.zh-CN.md

@ -56,10 +56,7 @@ timeline: true
- <Calendar defaultValue={new Date('2010-10-10')} /> - <Calendar defaultValue={new Date('2010-10-10')} />
+ <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} /> + <Calendar defaultValue={moment('2010-10-10', 'YYYY-MM-DD')} />
``` ```
* 时间类组件的 `onChange``onPanelChange` 及其他回调函数中为 `Date/GregorianCalendar` 类型的参数,均修改为 moment 类型,两者 API 有所不同,但功能基本一致,请对照 [moment 的 API 文档](http://momentjs.com/docs/) 和 [gregorian-calendar 的文档](https://github.com/yiminghe/gregorian-calendar) 进行修改。GregorianCalendar 的 API 与 moment API 的对应关系,不完全列举: * 时间类组件的 `onChange``onPanelChange` 及其他回调函数中为 `Date/GregorianCalendar` 类型的参数,均修改为 moment 类型,两者 API 有所不同,但功能基本一致,请对照 [moment 的 API 文档](http://momentjs.com/docs/) 和 [gregorian-calendar 的文档](https://github.com/yiminghe/gregorian-calendar) 进行修改。你也可以参考这个 [commit](https://github.com/ant-design/ant-design/commit/5a4ebe535f0353089b30ac331bc4fb7877963371) 来进行修改。
```jsx
time.getTime() => time.valueOf()
```
由于 `JSON.stringy(date: moment)` 返回的值会丢失时区设置,所以要先使用 `.format` 把日期转成字符串,相关 issue 见 [#3082](https://github.com/ant-design/ant-design/issues/3082): 由于 `JSON.stringy(date: moment)` 返回的值会丢失时区设置,所以要先使用 `.format` 把日期转成字符串,相关 issue 见 [#3082](https://github.com/ant-design/ant-design/issues/3082):
```js ```js

Loading…
Cancel
Save