diff options
Diffstat (limited to 'src/Combobox.jsx')
-rw-r--r-- | src/Combobox.jsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Combobox.jsx b/src/Combobox.jsx index d2c934c..958e108 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx | |||
@@ -56,15 +56,12 @@ const Combobox = React.createClass({ | |||
56 | value.minute(+itemValue); | 56 | value.minute(+itemValue); |
57 | } else if (type === 'ampm') { | 57 | } else if (type === 'ampm') { |
58 | if (use12Hours) { | 58 | if (use12Hours) { |
59 | if (itemValue === 'PM' && value.hour() <= 12) { | 59 | if (itemValue === 'PM' && value.hour() < 12) { |
60 | value.hour(value.hour() + 12); | 60 | value.hour((value.hour() % 12) + 12); |
61 | } | 61 | } |
62 | 62 | ||
63 | if (itemValue === 'AM') { | 63 | if (itemValue === 'AM') { |
64 | if (!value.hour()) { | 64 | if (value.hour() >= 12) { |
65 | value.hour(12); | ||
66 | } else | ||
67 | if (value.hour() > 12) { | ||
68 | value.hour(value.hour() - 12); | 65 | value.hour(value.hour() - 12); |
69 | } | 66 | } |
70 | } | 67 | } |