diff --git a/public/assets/community/judaism.js b/public/assets/community/judaism.js index b5de0d340..05c8fed76 100644 --- a/public/assets/community/judaism.js +++ b/public/assets/community/judaism.js @@ -601,56 +601,3 @@ window.addEventListener("load", async () => { }); - -///////// -window.addEventListener("load", async () => { - const container = document.createElement('div'); - container.innerHTML = "
"; - container.classList.add('widget', 'has-margin-4'); - - const disclaimerNotice = document.querySelector('.widget.is-yellow:first-child'); - disclaimerNotice.parentNode.insertBefore(container, disclaimerNotice.nextSibling); - - const result = await fetch('https://www.hebcal.com/hebcal?v=1&cfg=json&year=now&month=now&d=on&o=on'); - const response = await result.json() - - const parsedData = response.items.reduce((rv, x) => { - (rv[x.date] = rv[x.date] || []).push(x); - return rv; - }, {}); - - let now = new Date(); - if (now.getHours() > 20) { - now.setDate(now.getDate() + 1); - } - - now = now.toISOString().substr(0, 10); - - const fields = parsedData[now]; - container.querySelector('._cal_val').innerHTML = ""; - - fields.forEach(field => { - const fieldContainer = document.createElement('div'); - fieldContainer.classList.add('has-font-size-larger', 'h-fw-bold', 'h-m-t-2'); - container.querySelector('._cal_val').appendChild(fieldContainer); - - fieldContainer.innerText = field.title; - }); - - const DAY_LIST = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; - - let today = new Date(); - if (today.getHours() > 20) { - today.setDate(today.getDate() + 1); - } - - const todayDay = DAY_LIST[(today.getDay() + 6) % 7]; - today.setDate(today.getDate() - 1); - const yesterdayDay = DAY_LIST[(today.getDay() + 6) % 7]; - - const fieldContainer = document.createElement('div'); - fieldContainer.classList.add('h-m-t-2', 'has-font-size-caption'); - container.querySelector('._cal_val').appendChild(fieldContainer); - - fieldContainer.innerText = yesterdayDay + ' night (' + todayDay + ')'; -}); \ No newline at end of file