From 11b97949da16fc090400a753189baf10f29c111f Mon Sep 17 00:00:00 2001
From: MG12 <wuzhao.mail@gmail.com>
Date: Thu, 19 Nov 2015 15:15:03 +0800
Subject: use another method to change time and fix the bug about
 value.getTime()

---
 src/module/Header.jsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/module/Header.jsx')

diff --git a/src/module/Header.jsx b/src/module/Header.jsx
index 92a0089..b65fd25 100644
--- a/src/module/Header.jsx
+++ b/src/module/Header.jsx
@@ -57,9 +57,9 @@ const Header = React.createClass({
 
       if (value) {
         if (
-          hourOptions.indexOf(value.fields[4]) < 0 ||
-          minuteOptions.indexOf(value.fields[5]) < 0 ||
-          secondOptions.indexOf(value.fields[6]) < 0
+          hourOptions.indexOf(value.getHourOfDay()) < 0 ||
+          minuteOptions.indexOf(value.getMinutes()) < 0 ||
+          secondOptions.indexOf(value.getSeconds()) < 0
         ) {
           this.setState({
             invalid: true,
@@ -69,9 +69,9 @@ const Header = React.createClass({
 
         if (originalValue && value) {
           if (
-            originalValue.fields[4] !== value.fields[4] ||
-            originalValue.fields[5] !== value.fields[5] ||
-            originalValue.fields[6] !== value.fields[6]
+            originalValue.getHourOfDay() !== value.getHourOfDay() ||
+            originalValue.getMinutes() !== value.getMinutes() ||
+            originalValue.getSeconds() !== value.getSeconds()
           ) {
             onChange(value);
           }
-- 
cgit v1.2.3

