+ disabledHours = () => {
+ const { use12Hours, disabledHours } = this.props;
+ let disabledOptions = disabledHours();
+ if (use12Hours && Array.isArray(disabledOptions)) {
+ if (this.isAM()) {
+ disabledOptions = disabledOptions.filter(h => h < 12).map(h => (h === 0 ? 12 : h));
+ } else {
+ disabledOptions = disabledOptions.map(h => (h === 12 ? 12 : h - 12));
+ }
+ }
+ return disabledOptions;
+ }
+
+ isAM() {
+ const value = (this.state.value || this.props.defaultOpenValue);
+ return value.hour() >= 0 && value.hour() < 12;
+ }
+