From eb3c19e2cd2e11cec1eed9337ce44a312b3fc60b Mon Sep 17 00:00:00 2001 From: Antony Shaleynikov Date: Mon, 6 Mar 2017 12:51:39 +0300 Subject: Added support for lower/uppercase of AM/PM selectors --- src/Combobox.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Combobox.jsx b/src/Combobox.jsx index 958e108..00f122f 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx @@ -145,11 +145,15 @@ const Combobox = React.createClass({ }, 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 ( -- cgit v1.2.3