From c98e4430b1fc739a3aafce0a9f30ad89d6901bed Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Tue, 21 Aug 2018 00:36:57 -0400 Subject: [PATCH] forgot about midnight case in 24hr --- client/src/builtin/24Hour.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/builtin/24Hour.js b/client/src/builtin/24Hour.js index 2feb5e3c..49aec6f2 100644 --- a/client/src/builtin/24Hour.js +++ b/client/src/builtin/24Hour.js @@ -25,7 +25,7 @@ export default new class TwentyFourHour extends BuiltinModule { MonkeyPatch('BD:TwentyFourHour', TimeFormatter).after('calendarFormat', (thisObject, args, returnValue) => { const matched = returnValue.match(twelveHour); if (!matched || matched.length != 4) return; - if (matched[3] == 'AM') return returnValue.replace(matched[0], `${matched[1].padStart(2, '0')}:${matched[2]}`) + if (matched[3] == 'AM') return returnValue.replace(matched[0], `${matched[1] == '12' ? '00' : matched[1].padStart(2, '0')}:${matched[2]}`) return returnValue.replace(matched[0], `${parseInt(matched[1]) + 12}:${matched[2]}`) }); }