diff options
Diffstat (limited to 'src/TimePicker.jsx')
-rw-r--r-- | src/TimePicker.jsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/TimePicker.jsx b/src/TimePicker.jsx index 6b76223..7065333 100644 --- a/src/TimePicker.jsx +++ b/src/TimePicker.jsx | |||
@@ -128,10 +128,21 @@ const Picker = React.createClass({ | |||
128 | }, | 128 | }, |
129 | 129 | ||
130 | getFormat() { | 130 | getFormat() { |
131 | const { format, showHour, showMinute, showSecond } = this.props; | 131 | const { format, showHour, showMinute, showSecond, use12Hours } = this.props; |
132 | if (format) { | 132 | if (format) { |
133 | return format; | 133 | return format; |
134 | } | 134 | } |
135 | |||
136 | if (use12Hours) { | ||
137 | const fmtString = ([ | ||
138 | showHour ? 'h' : '', | ||
139 | showMinute ? 'mm' : '', | ||
140 | showSecond ? 'ss' : '', | ||
141 | ].filter(item => !!item).join(':')); | ||
142 | |||
143 | return fmtString.concat(' a'); | ||
144 | } | ||
145 | |||
135 | return [ | 146 | return [ |
136 | showHour ? 'HH' : '', | 147 | showHour ? 'HH' : '', |
137 | showMinute ? 'mm' : '', | 148 | showMinute ? 'mm' : '', |