From 4f5987b72aedde6e4732aba89680aaa16cd5d306 Mon Sep 17 00:00:00 2001 From: Dylan Leonard Date: Mon, 18 Sep 2017 14:20:28 -0400 Subject: [PATCH] Added cases to accept both a.m./p.m. and AM/PM --- app/src/main/java/info/nightscout/utils/DateUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/utils/DateUtil.java b/app/src/main/java/info/nightscout/utils/DateUtil.java index e94188f826..ccaae130b7 100644 --- a/app/src/main/java/info/nightscout/utils/DateUtil.java +++ b/app/src/main/java/info/nightscout/utils/DateUtil.java @@ -91,9 +91,9 @@ public class DateUtil { if (m.find()) { retval = SafeParse.stringToInt(m.group(1)) * 60 * 60 + SafeParse.stringToInt(m.group(2)) * 60; - if (m.group(3).equals(" AM") && m.group(1).equals("12")) + if (m.group(3).equals(" a.m.") || m.group(3).equals(" AM") && m.group(1).equals("12")) retval -= 12 * 60 * 60; - if (m.group(3).equals(" PM") && !(m.group(1).equals("12"))) + if (m.group(3).equals(" p.m.") || m.group(3).equals(" PM") && !(m.group(1).equals("12"))) retval += 12 * 60 * 60; } return retval;