aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/module/Header.jsx
diff options
context:
space:
mode:
authorMG12 <wuzhao.mail@gmail.com>2015-11-19 15:15:03 +0800
committerMG12 <wuzhao.mail@gmail.com>2015-11-19 15:15:03 +0800
commit11b97949da16fc090400a753189baf10f29c111f (patch)
treeaee755ef1eced68f70cca5d0427c75ab76ac7b36 /src/module/Header.jsx
parente75ed0c6b89282cf475e94d6d5ad0fb35803f974 (diff)
downloadtime-picker-11b97949da16fc090400a753189baf10f29c111f.tar.gz
time-picker-11b97949da16fc090400a753189baf10f29c111f.tar.zst
time-picker-11b97949da16fc090400a753189baf10f29c111f.zip
use another method to change time and fix the bug about value.getTime()
Diffstat (limited to 'src/module/Header.jsx')
-rw-r--r--src/module/Header.jsx12
1 files changed, 6 insertions, 6 deletions
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({
57 57
58 if (value) { 58 if (value) {
59 if ( 59 if (
60 hourOptions.indexOf(value.fields[4]) < 0 || 60 hourOptions.indexOf(value.getHourOfDay()) < 0 ||
61 minuteOptions.indexOf(value.fields[5]) < 0 || 61 minuteOptions.indexOf(value.getMinutes()) < 0 ||
62 secondOptions.indexOf(value.fields[6]) < 0 62 secondOptions.indexOf(value.getSeconds()) < 0
63 ) { 63 ) {
64 this.setState({ 64 this.setState({
65 invalid: true, 65 invalid: true,
@@ -69,9 +69,9 @@ const Header = React.createClass({
69 69
70 if (originalValue && value) { 70 if (originalValue && value) {
71 if ( 71 if (
72 originalValue.fields[4] !== value.fields[4] || 72 originalValue.getHourOfDay() !== value.getHourOfDay() ||
73 originalValue.fields[5] !== value.fields[5] || 73 originalValue.getMinutes() !== value.getMinutes() ||
74 originalValue.fields[6] !== value.fields[6] 74 originalValue.getSeconds() !== value.getSeconds()
75 ) { 75 ) {
76 onChange(value); 76 onChange(value);
77 } 77 }