From 36abb7da3625be510de585d0a6f66143c6bac002 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Sat, 25 Feb 2023 14:39:05 +0100 Subject: [PATCH] fixed dates before now --- lib/service/date_service.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/service/date_service.dart b/lib/service/date_service.dart index be45fe6..257afc1 100644 --- a/lib/service/date_service.dart +++ b/lib/service/date_service.dart @@ -48,7 +48,8 @@ List createTZDateTimes( selectedDays.map((day) => weekDays[day]); for (int i = 0; i < trainingTime; i++) { final DateTime date = DateTime.now().add(Duration(days: i)); - if (selectedDaysInt.contains(date.weekday)) { + if (selectedDaysInt.contains(date.weekday) && + date.isAfter(DateTime.now())) { tzDateTimes.add(TZDateTime.local(date.year, date.month, date.day, selectedHours, selectedMinutes, 0, 0, 0)); }