Skip to content

Commit

Permalink
Fix correction to candleLighting
Browse files Browse the repository at this point in the history
It had been making up for the suncalc bug by checking the next day...
Small optimization to previous commit: save the greg date in a variable
  • Loading branch information
Scimonster committed May 17, 2017
1 parent 8628ffa commit 02cdf92
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 25 deletions.
9 changes: 5 additions & 4 deletions client/hebcal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/hebcal.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client/hebcal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/hebcal.min.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions client/hebcal.noloc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client/hebcal.noloc.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/hebcal.noloc.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/hebcal.noloc.min.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions hdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ prototype.setLocation = function(lat, lon) {
};

function suntime(hdate) {
//reset the date to midday before calling suncalc api
//https://github.com/mourner/suncalc/issues/11
return suncalc.getTimes(new Date(hdate.greg().getFullYear(), hdate.greg().getMonth(), hdate.greg().getDate(), 12, 0, 0, 0, 0), hdate.lat, hdate.long);
// reset the date to midday before calling suncalc api
// https://github.com/mourner/suncalc/issues/11
var date = hdate.greg();
return suncalc.getTimes(new Date(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0, 0, 0), hdate.lat, hdate.long);
}

prototype.sunrise = function() {
Expand Down
2 changes: 1 addition & 1 deletion holidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Event.prototype.getDesc = function(o) {
};

Event.prototype.candleLighting = function() {
var date = this.date.next();
var date = this.date;
if (this.LIGHT_CANDLES) {
return new Date(date.sunset() - (Event.candleLighting * 60 * 1000));
} else if (this.LIGHT_CANDLES_TZEIS) {
Expand Down

0 comments on commit 02cdf92

Please sign in to comment.