From 05a0c34b579cec9e09376c12fd253b2109e292b5 Mon Sep 17 00:00:00 2001 From: Javad Mnjd Date: Wed, 11 May 2022 19:15:14 +0430 Subject: [PATCH] feat(prayertimes): expose sunset time closes #105 --- src/PrayerTimes.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PrayerTimes.ts b/src/PrayerTimes.ts index c36eeec..c13d05d 100644 --- a/src/PrayerTimes.ts +++ b/src/PrayerTimes.ts @@ -24,6 +24,7 @@ export default class PrayerTimes { sunrise: Date; dhuhr: Date; asr: Date; + sunset: Date; maghrib: Date; isha: Date; @@ -39,6 +40,7 @@ export default class PrayerTimes { let sunriseTime: Date; let dhuhrTime: Date; let asrTime: Date; + let sunsetTime: Date; let maghribTime: Date; let ishaTime: Date; @@ -54,7 +56,7 @@ export default class PrayerTimes { date.getMonth(), date.getDate(), ); - let sunsetTime = new TimeComponents(solarTime.sunset).utcDate( + sunsetTime = new TimeComponents(solarTime.sunset).utcDate( date.getFullYear(), date.getMonth(), date.getDate(), @@ -220,6 +222,7 @@ export default class PrayerTimes { dateByAddingMinutes(asrTime, asrAdjustment), calculationParameters.rounding, ); + this.sunset = roundedMinute(sunsetTime, calculationParameters.rounding); this.maghrib = roundedMinute( dateByAddingMinutes(maghribTime, maghribAdjustment), calculationParameters.rounding,