From e5ce8c2d6766dc8483379c1993f6ed0ac289b746 Mon Sep 17 00:00:00 2001 From: Magomed Achtaew <122747757+magondev@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:41:43 +0100 Subject: [PATCH] added first third of the night to SunnahTimes --- lib/src/sunnah_times.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/src/sunnah_times.dart b/lib/src/sunnah_times.dart index 08a29eb..d515fb4 100644 --- a/lib/src/sunnah_times.dart +++ b/lib/src/sunnah_times.dart @@ -3,6 +3,12 @@ import 'data/calendar_util.dart'; import 'data/date_components.dart'; class SunnahTimes { + /// The beginning of the first third of the period between Maghrib and Fajr + late DateTime _firstThirdOfTheNight; + + /// The beginning of the first third of the period between Maghrib and Fajr + DateTime get firstThirdOfTheNight => _firstThirdOfTheNight; + /// The midpoint between Maghrib and Fajr late DateTime _middleOfTheNight; @@ -36,6 +42,9 @@ class SunnahTimes { prayerTimes.maghrib.millisecondsSinceEpoch) ~/ 1000; + _firstThirdOfTheNight = CalendarUtil.roundedMinute(prayerTimes.maghrib.add( + Duration(seconds: (nightDurationInSeconds ~/ 3.0).toInt()))); + _middleOfTheNight = CalendarUtil.roundedMinute(prayerTimes.maghrib .add(Duration(seconds: nightDurationInSeconds ~/ 2.0)));