From 2ddd3f1837470a5305ca788d8b45fe63e68e5cb2 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Tue, 2 Feb 2016 14:47:20 +0800 Subject: [PATCH] keep date stable --- package.json | 2 +- src/module/Header.jsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f2edee8..1c56ac4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-time-picker", - "version": "1.1.0", + "version": "1.1.1", "description": "React TimePicker", "keywords": [ "react", 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); -- 2.41.0