Skip to content

Commit

Permalink
Upgrade Hiloulot listing, fix Av issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NightScript370 committed Dec 24, 2024
1 parent 545acef commit 2f9afda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions assets/js/WebsiteCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,11 @@ class WebsiteCalendar extends KosherZmanim.JewishCalendar {

isShvuaShechalBo() {
//shevua shechal bo happens on the whole week that tisha beav falls out on
if (this.getJewishMonth() !== KosherZmanim.JewishDate.AV)
if (this.getJewishMonth() !== KosherZmanim.JewishDate.AV || this.getJewishDayOfMonth() >= 10)
return false;

const currentDate = this.getDate();
this.setJewishDayOfMonth(9);//set to the 9th of Av
if ([KosherZmanim.Calendar.SATURDAY, KosherZmanim.Calendar.SUNDAY].includes(this.getDayOfWeek())) {

if ([6, 7].includes(this.getDate().withCalendar("hebrew").with({ day: 9 }).dayOfWeek))
return false;//there is no shevua shechal bo if tisha beav falls out on a sunday or shabbat
}
this.setDate(currentDate);//reset the date

const daysOfShvuaShechalBo = [];
for (
Expand Down
2 changes: 1 addition & 1 deletion assets/js/zmanimListUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class zmanimListUpdater {

const tableData = [...new Set(workerData.flat().map(field => JSON.stringify(field)))]
.map(field => JSON.parse(field))
.sort((a, b) => new Date(Object.values(a)[1].v) - new Date(Object.values(b)[1].v))
.sort((a, b) => new Date(Object.values(a)[1].v).getTime() - new Date(Object.values(b)[1].v).getTime())

const { utils, writeFile } = (await import('../libraries/xlsx.mjs'));
const ws = utils.json_to_sheet([headerRow].concat(tableData), { skipHeader: true });
Expand Down
2 changes: 1 addition & 1 deletion assets/libraries/kosherZmanim/hiloulah-en.json

Large diffs are not rendered by default.

0 comments on commit 2f9afda

Please sign in to comment.