From 38fcb027ca016ca0788a5d39643e59f7de0a233f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20=C5=A0ko=C5=99epa?= <58693944+Brambora0@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:47:49 +0100 Subject: [PATCH] Fix/nelze menit datum posledni navstevy u vlastnich prohlidek spatne razeni#117 (#470) * fix/nelze_zmenit_datum_posledni_navstevy_vlastnich_prohlidek (https://github.com/Loono-cz/loono-tasks/issues/117) * fix/nelze_zmenit_datum_posledni_navstevy_vlastnich_prohlidek (https://github.com/Loono-cz/loono-tasks/issues/117) --- lib/helpers/examination_extensions.dart | 4 +++- lib/ui/widgets/prevention/examinations_sheet_overlay.dart | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/helpers/examination_extensions.dart b/lib/helpers/examination_extensions.dart index 025b426d..1968c1fa 100644 --- a/lib/helpers/examination_extensions.dart +++ b/lib/helpers/examination_extensions.dart @@ -100,7 +100,9 @@ extension SelfExaminationPreventionStatusExt on SelfExaminationPreventionStatus extension ExaminationExt on ExaminationPreventionStatus { DateTime? get targetExamDate { - if (plannedDate != null && plannedDate != lastConfirmedDate) { + if (plannedDate != null && + plannedDate != lastConfirmedDate && + plannedDate?.isAfter(lastConfirmedDate ?? DateTime.fromMillisecondsSinceEpoch(0)) == true) { return DateTime( plannedDate!.year, plannedDate!.month, diff --git a/lib/ui/widgets/prevention/examinations_sheet_overlay.dart b/lib/ui/widgets/prevention/examinations_sheet_overlay.dart index 9f7dbd73..3e4ea128 100644 --- a/lib/ui/widgets/prevention/examinations_sheet_overlay.dart +++ b/lib/ui/widgets/prevention/examinations_sheet_overlay.dart @@ -93,7 +93,6 @@ class ExaminationsSheetOverlay extends StatelessWidget { final categorizedExaminations = categorized.where((e) => e.category == examinationStatus).toList(); - //..sortExaminations(); return Column( children: [