aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/module/Header.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/module/Header.jsx')
-rw-r--r--src/module/Header.jsx15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/module/Header.jsx b/src/module/Header.jsx
index fec02af..9a048dc 100644
--- a/src/module/Header.jsx
+++ b/src/module/Header.jsx
@@ -13,9 +13,9 @@ const Header = React.createClass({
13 hourOptions: PropTypes.array, 13 hourOptions: PropTypes.array,
14 minuteOptions: PropTypes.array, 14 minuteOptions: PropTypes.array,
15 secondOptions: PropTypes.array, 15 secondOptions: PropTypes.array,
16 disabledHours: PropTypes.array, 16 disabledHours: PropTypes.func,
17 disabledMinutes: PropTypes.array, 17 disabledMinutes: PropTypes.func,
18 disabledSeconds: PropTypes.array, 18 disabledSeconds: PropTypes.func,
19 onChange: PropTypes.func, 19 onChange: PropTypes.func,
20 onClear: PropTypes.func, 20 onClear: PropTypes.func,
21 onEsc: PropTypes.func, 21 onEsc: PropTypes.func,
@@ -87,10 +87,13 @@ const Header = React.createClass({
87 } 87 }
88 88
89 // if time value is disabled, response warning. 89 // if time value is disabled, response warning.
90 const disabledHourOptions = disabledHours();
91 const disabledMinuteOptions = disabledMinutes(value.getHourOfDay());
92 const disabledSecondOptions = disabledSeconds(value.getHourOfDay(), value.getMinutes());
90 if ( 93 if (
91 (disabledHours && disabledHours.indexOf(value.getHourOfDay()) >= 0) || 94 (disabledHourOptions && disabledHourOptions.indexOf(value.getHourOfDay()) >= 0) ||
92 (disabledMinutes && disabledMinutes.indexOf(value.getMinutes()) >= 0) || 95 (disabledMinuteOptions && disabledMinuteOptions.indexOf(value.getMinutes()) >= 0) ||
93 (disabledSeconds && disabledSeconds.indexOf(value.getSeconds()) >= 0) 96 (disabledSecondOptions && disabledSecondOptions.indexOf(value.getSeconds()) >= 0)
94 ) { 97 ) {
95 this.setState({ 98 this.setState({
96 invalid: true, 99 invalid: true,