From 2ddd3f1837470a5305ca788d8b45fe63e68e5cb2 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Tue, 2 Feb 2016 14:47:20 +0800 Subject: keep date stable --- src/module/Header.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/module/Header.jsx b/src/module/Header.jsx index 9a048dc..33dec43 100644 --- a/src/module/Header.jsx +++ b/src/module/Header.jsx @@ -107,7 +107,12 @@ const Header = React.createClass({ originalValue.getMinutes() !== value.getMinutes() || originalValue.getSeconds() !== value.getSeconds() ) { - onChange(value); + // keep other fields for rc-calendar + const changedValue = originalValue.clone(); + changedValue.setHourOfDay(value.getHourOfDay()); + changedValue.setMinutes(value.getMinutes()); + changedValue.setSeconds(value.getSeconds()); + onChange(changedValue); } } else if (originalValue !== value) { onChange(value); -- cgit v1.2.3