From c1b40cabff82ed1b7a24fd9baf74e7a8e64119e5 Mon Sep 17 00:00:00 2001 From: Antony Shaleynikov Date: Mon, 6 Mar 2017 13:01:07 +0300 Subject: [PATCH] Fixed lowercased AM/PM handling --- src/Combobox.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Combobox.jsx b/src/Combobox.jsx index 00f122f..36b61cc 100644 --- a/src/Combobox.jsx +++ b/src/Combobox.jsx @@ -55,12 +55,13 @@ const Combobox = React.createClass({ } else if (type === 'minute') { value.minute(+itemValue); } else if (type === 'ampm') { + const ampm = itemValue.toUpperCase(); if (use12Hours) { - if (itemValue === 'PM' && value.hour() < 12) { + if (ampm === 'PM' && value.hour() < 12) { value.hour((value.hour() % 12) + 12); } - if (itemValue === 'AM') { + if (ampm === 'AM') { if (value.hour() >= 12) { value.hour(value.hour() - 12); } -- 2.41.0