import TimePicker from 'rc-time-picker';
const showSecond = false;
-const str = showSecond ? 'HH:mm:ss' : 'HH:mm';
+const str = showSecond ? 'h:mm a' : 'h:mm a';
const now = moment().hour(0).minute(0);
defaultValue={now}
className="xxx"
onChange={onChange}
+ format={str}
use12Hours
/>,
document.getElementById('__react-content')
},
getAMPMSelect() {
- const { prefixCls, use12Hours } = this.props;
+ const { prefixCls, use12Hours, format } = this.props;
if (!use12Hours) {
return null;
}
- const AMPMOptions = [{ value: 'AM' }, { value: 'PM' }];
+
+ 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;
return (