diff --git a/lib/views/widgets/pentry/pentry_calibration_tool_form.dart b/lib/views/widgets/pentry/pentry_calibration_tool_form.dart index 6ffdda99..4991d2be 100644 --- a/lib/views/widgets/pentry/pentry_calibration_tool_form.dart +++ b/lib/views/widgets/pentry/pentry_calibration_tool_form.dart @@ -91,6 +91,7 @@ class _PentryCalibrationToolFormState extends State { ADatePicker( label: context.translation.calibrationDate, date: DateTime.tryParse(model.calibrationDateOfTesters ?? ""), + from: DateTime.now().subtract(const Duration(days: 90)), backgroundColor: context.isDark ? AppColor.neutral50 : AppColor.background(context), withBorder: false, onDatePicker: (date) { diff --git a/lib/views/widgets/pentry/pentry_tbs_form.dart b/lib/views/widgets/pentry/pentry_tbs_form.dart index 4db0b68a..ce5871f1 100644 --- a/lib/views/widgets/pentry/pentry_tbs_form.dart +++ b/lib/views/widgets/pentry/pentry_tbs_form.dart @@ -87,6 +87,11 @@ class _PentryTBSFormState extends State { from: DateTime.now().subtract(const Duration(days: 30)), onDatePicker: (date) { if (date == null) return; + if (date.isBefore(DateTime.parse(widget.model.expectedDate))) { + "Actual visit date must be greater then expected date".showToast; + return; + } + widget.model.actualDate = date?.toIso8601String(); setState(() {}); },