From e7e22602ef2a93976a929e049c4d72e21f05488d Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 13 Oct 2016 18:04:21 +0800 Subject: [PATCH] docs: update change log --- CHANGELOG.en-US.md | 5 +---- CHANGELOG.zh-CN.md | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 60eef8985f..5e366cfc41 100644 --- a/CHANGELOG.en-US.md +++ b/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 - + ``` -* 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): - ```jsx - time.getTime() => time.valueOf(); - ``` +* 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. 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 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 192b243e93..57fbcc42a6 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -56,10 +56,7 @@ timeline: true - + ``` -* 时间类组件的 `onChange` 和 `onPanelChange` 及其他回调函数中为 `Date/GregorianCalendar` 类型的参数,均修改为 moment 类型,两者 API 有所不同,但功能基本一致,请对照 [moment 的 API 文档](http://momentjs.com/docs/) 和 [gregorian-calendar 的文档](https://github.com/yiminghe/gregorian-calendar) 进行修改。GregorianCalendar 的 API 与 moment API 的对应关系,不完全列举: - ```jsx - time.getTime() => time.valueOf() - ``` +* 时间类组件的 `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) 来进行修改。 由于 `JSON.stringy(date: moment)` 返回的值会丢失时区设置,所以要先使用 `.format` 把日期转成字符串,相关 issue 见 [#3082](https://github.com/ant-design/ant-design/issues/3082): ```js