Skip to content

Commit 101192a

Browse files
authored
Merge pull request batoulapps#108 from jd1378/develop
expose sunset in prayerTimes (ts)
2 parents 044d46e + 05a0c34 commit 101192a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PrayerTimes.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class PrayerTimes {
2424
sunrise: Date;
2525
dhuhr: Date;
2626
asr: Date;
27+
sunset: Date;
2728
maghrib: Date;
2829
isha: Date;
2930

@@ -39,6 +40,7 @@ export default class PrayerTimes {
3940
let sunriseTime: Date;
4041
let dhuhrTime: Date;
4142
let asrTime: Date;
43+
let sunsetTime: Date;
4244
let maghribTime: Date;
4345
let ishaTime: Date;
4446

@@ -54,7 +56,7 @@ export default class PrayerTimes {
5456
date.getMonth(),
5557
date.getDate(),
5658
);
57-
let sunsetTime = new TimeComponents(solarTime.sunset).utcDate(
59+
sunsetTime = new TimeComponents(solarTime.sunset).utcDate(
5860
date.getFullYear(),
5961
date.getMonth(),
6062
date.getDate(),
@@ -220,6 +222,7 @@ export default class PrayerTimes {
220222
dateByAddingMinutes(asrTime, asrAdjustment),
221223
calculationParameters.rounding,
222224
);
225+
this.sunset = roundedMinute(sunsetTime, calculationParameters.rounding);
223226
this.maghrib = roundedMinute(
224227
dateByAddingMinutes(maghribTime, maghribAdjustment),
225228
calculationParameters.rounding,

0 commit comments

Comments
 (0)