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)));