From 0eb5a89d18786f7b4071b883838f92c00db09f43 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 29 Dec 2010 00:19:57 -0500 Subject: [PATCH] absolute times before 7:00 without AM/PM default to PM --- Command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Command.py b/Command.py index 48ed9ad..726e79c 100644 --- a/Command.py +++ b/Command.py @@ -55,7 +55,9 @@ class Command: h = int(m.group(1)) mins = 0 if m.group(2) is None else int(m.group(2)) am_pm = '' if m.group(3) is None else m.group(3).lower() - if len(am_pm) >= 1 and am_pm[0] == 'p' and h < 12: + if am_pm == '' and h < 7: + h += 12 + elif len(am_pm) >= 1 and am_pm[0] == 'p' and h < 12: h += 12 elif len(am_pm) >= 1 and am_pm[0] == 'a' and h == 12: h = 0