From e4a697a2bc9de287201f7d91076239a42fd21f59 Mon Sep 17 00:00:00 2001 From: Sascha Englert Date: Wed, 2 Oct 2024 22:42:03 +0200 Subject: [PATCH] Fix cycle calculation Plants should only be marked as cared for when they are due on the date the button is pressed --- lib/screens/home_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/home_page.dart b/lib/screens/home_page.dart index 48332f8..289fcf1 100644 --- a/lib/screens/home_page.dart +++ b/lib/screens/home_page.dart @@ -425,7 +425,7 @@ class _MyHomePageState extends State { for (Plant p in allPlants) { for (Care c in p.cares) { var daysSinceLastCare = dateCheck.difference(c.effected!).inDays; - if (daysSinceLastCare != 0 && daysSinceLastCare % c.cycles >= 0) { + if (daysSinceLastCare != 0 && daysSinceLastCare % c.cycles == 0) { c.effected = DateTime.now(); } }