- const value = this.props.value || defaultOpenValue;
- const AMPMOptions = [{ value: 'AM' }, { value: 'PM' }];
- const selected = (!value.hour() || value.hour() > 12) ? 1 : 0;
+
+ const AMPMOptions = ['am', 'pm'] // If format has A char, then we should uppercase AM/PM
+ .map(c => format.match(/\sA/) ? c.toUpperCase() : c)
+ .map(c => ({ value: c }));
+
+ const selected = this.isAM() ? 0 : 1;