From 2d3d39d1dc3b341cdea0b62dc47b60f065b05125 Mon Sep 17 00:00:00 2001 From: "Markus M. May" Date: Tue, 1 May 2018 23:43:18 +0200 Subject: [PATCH] Use common helper method for day calculation --- .../plugins/ConstraintsObjectives/ObjectivesFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesFragment.java index a544460462..e4cdab4c80 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesFragment.java @@ -26,6 +26,7 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.Common.SubscriberFragment; import info.nightscout.utils.FabricPrivacy; +import info.nightscout.utils.T; public class ObjectivesFragment extends SubscriberFragment { private static Logger log = LoggerFactory.getLogger(ObjectivesFragment.class); @@ -204,7 +205,7 @@ public class ObjectivesFragment extends SubscriberFragment { return 1; } else if (objectiveStartedTime > 0 && !enableFakeValue && objectiveAccomplishedTime == 0 - && !(objectiveStartedTime + (long)durationInDays * 24 * 60 * 60 * 1000 < now && requirementsMet)) { + && !(objectiveStartedTime + T.days(durationInDays).msecs() < now && requirementsMet)) { return 2; } else if (objectiveAccomplishedTime == 0) { return 3;