From 9a6b00147c1e96b44b904ad6989cc845e44bf8c5 Mon Sep 17 00:00:00 2001 From: ruben beck Date: Fri, 11 Aug 2023 15:51:41 +0200 Subject: [PATCH] new isBetween func --- lib/utils/date.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/utils/date.dart b/lib/utils/date.dart index 6ab789a69..4ef64e54c 100644 --- a/lib/utils/date.dart +++ b/lib/utils/date.dart @@ -29,6 +29,16 @@ class BreezDateUtils { } } + static bool isBetween( + DateTime date, + DateTime fromDateTime, + DateTime toDateTime, + ) { + final isAfter = date.isAfter(fromDateTime); + final isBefore = date.isBefore(toDateTime); + return isAfter && isBefore; + } + static String formatHourMinute(DateTime d) => _hourMinuteDayFormat.format(d); static String formatFilterDateRange(DateTime startDate, DateTime endDate) {