Skip to content

Commit

Permalink
added first third of the night to SunnahTimes
Browse files Browse the repository at this point in the history
  • Loading branch information
magondev committed Feb 7, 2024
1 parent d4e4f04 commit e5ce8c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/src/sunnah_times.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 10 in lib/src/sunnah_times.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/sunnah_times.dart#L10

Added line #L10 was not covered by tests

/// The midpoint between Maghrib and Fajr
late DateTime _middleOfTheNight;

Expand Down Expand Up @@ -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)));

Expand Down

0 comments on commit e5ce8c2

Please sign in to comment.