From 92dc0dc2b0fa0e9570d31d2dc95b7839f16dbffe Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Fri, 27 Jul 2018 10:45:49 +0800 Subject: [PATCH] feat: add onChange for Calendar --- components/calendar/index.en-US.md | 1 + components/calendar/index.tsx | 8 +++++++- components/calendar/index.zh-CN.md | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/calendar/index.en-US.md b/components/calendar/index.en-US.md index dddcdab367..0b60d8c6d0 100644 --- a/components/calendar/index.en-US.md +++ b/components/calendar/index.en-US.md @@ -44,3 +44,4 @@ When data is in the form of dates, such as schedules, timetables, prices calenda | value | The current selected date | [moment](http://momentjs.com/) | current date | | onPanelChange | Callback for when panel changes | function(date: moment, mode: string) | - | | onSelect | Callback for when a date is selected | function(date: moment) | - | +| onChange | Callback for when date changes | function(date: moment) | - | diff --git a/components/calendar/index.tsx b/components/calendar/index.tsx index c27227b181..b31eb2b16c 100644 --- a/components/calendar/index.tsx +++ b/components/calendar/index.tsx @@ -36,6 +36,7 @@ export interface CalendarProps { style?: React.CSSProperties; onPanelChange?: (date?: moment.Moment, mode?: CalendarMode) => void; onSelect?: (date?: moment.Moment) => void; + onChange?: (date?: moment.Moment) => void; disabledDate?: (current: moment.Moment) => boolean; validRange ?: [moment.Moment, moment.Moment]; } @@ -53,6 +54,7 @@ export default class Calendar extends React.Component { diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index 0ae9309c59..b3d57bb201 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -45,3 +45,4 @@ title: Calendar | value | 展示日期 | [moment](http://momentjs.com/) | 当前日期 | | onPanelChange | 日期面板变化回调 | function(date: moment, mode: string) | 无 | | onSelect | 点击选择日期回调 | function(date: moment) | 无 | +| onChange | 日期变化回调 | function(date: moment) | 无 |