Yahrzeit Calendar Calculator

.yahrzeit-calculator-container { background-color: #f9f9f9; border: 1px solid #ccc; border-radius: 8px; padding: 20px; max-width: 700px; margin: 20px auto; font-family: Arial, sans-serif; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } .yahrzeit-calculator-container h2, .yahrzeit-calculator-container h3 { color: #333; text-align: center; } .yahrzeit-calculator-container p, .yahrzeit-calculator-container li { line-height: 1.6; color: #555; } .yahrzeit-calculator-form { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 20px; padding: 20px; border: 1px solid #ddd; border-radius: 5px; background-color: #fff; } .yahrzeit-calculator-form .input-group { display: flex; flex-direction: column; } .yahrzeit-calculator-form label { margin-bottom: 5px; font-weight: bold; color: #444; } .yahrzeit-calculator-form input[type="date"], .yahrzeit-calculator-form select { padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; width: 100%; box-sizing: border-box; } .yahrzeit-calculator-form button { background-color: #005a9c; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 18px; font-weight: bold; width: 100%; transition: background-color 0.3s; } .yahrzeit-calculator-form button:hover { background-color: #004170; } #yahrzeitResult { margin-top: 20px; padding: 15px; border: 1px dashed #005a9c; border-radius: 5px; background-color: #eef7ff; text-align: center; } #yahrzeitResult h4 { margin-top: 0; color: #004170; } #yahrzeitResult ul { list-style-type: none; padding: 0; } #yahrzeitResult li { background-color: #fff; margin-bottom: 8px; padding: 8px; border-radius: 4px; border: 1px solid #ddd; }

Yahrzeit Calendar Calculator

A Yahrzeit, which means "a year's time" in Yiddish, is the anniversary of a loved one's death. In Jewish tradition, this anniversary is observed annually according to the Hebrew calendar. Because the Hebrew calendar is a lunisolar calendar, the Gregorian date of a Yahrzeit changes every year. This calculator helps you determine the correct Hebrew date of passing and find the corresponding secular dates for future observances.

The Importance of Sunset

In the Jewish calendar, a new day begins at sunset, not at midnight. Therefore, if the passing occurred after sunset, the Yahrzeit is observed on the following day's date. This calculator accounts for this crucial detail. Please select whether the passing was before or after sunset for an accurate calculation.

How the Calculator Works

This tool converts the Gregorian (secular) date of passing into the corresponding Hebrew date. It then calculates the Gregorian dates for the upcoming Yahrzeit anniversaries for the next 10 years. The calculation also considers the complexities of the Hebrew calendar, such as leap years (which include an extra month, Adar II) and months that vary in length (Cheshvan and Kislev).

Before Sunset After Sunset

Example Calculation

Let's say a person passed away on the evening of October 28, 2023. Since it was after sunset, the Hebrew date is calculated based on the next secular day.

  • Gregorian Date Entered: October 28, 2023
  • Time Selected: After Sunset
  • Hebrew Date of Passing: 14th of Cheshvan, 5784
  • First Yahrzeit (14th of Cheshvan, 5785): November 15, 2024

Disclaimer: Jewish customs can vary. This calculator is based on common practice. For specific halachic (Jewish law) guidance, please consult with a Rabbi.

// Based on the work of Nachum Dershowitz and Edward M. Reingold in "Calendrical Calculations" var HEBREW_EPOCH = 347995.5; var GREGORIAN_EPOCH = 1721425.5; var hebrewMonthName = ["", "Nisan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Tevet", "Shevat", "Adar", "Adar I", "Adar II"]; var hebrewMonthAbbr = ["", "Nis", "Iyr", "Siv", "Tam", "Av", "Elu", "Tis", "Che", "Kis", "Tev", "She", "Ada", "Ad1", "Ad2"]; function isHebrewLeap(year) { return ((7 * year + 1) % 19) < 7; } function hebrewYearMonths(year) { return isHebrewLeap(year) ? 13 : 12; } function hebrewDelay1(year) { var months = Math.floor((235 * year – 234) / 19); var parts = 12084 + 1367 * months; var day = months * 29 + Math.floor(parts / 25920); if ((3 * (day + 1)) % 7 < 3) { day++; } return day; } function hebrewDelay2(year) { var last = hebrewDelay1(year – 1); var present = hebrewDelay1(year); return present – last; } function hebrewYearDays(year) { return hebrewDelay1(year + 1) – hebrewDelay1(year); } function hebrewMonthDays(year, month) { if (month === 2 || month === 4 || month === 6 || month === 10 || month === 13) { return 29; } if (month === 12 && !isHebrewLeap(year)) { return 29; } if (month === 8 && hebrewYearDays(year) % 10 !== 5) { return 29; } if (month === 9 && hebrewYearDays(year) % 10 === 3) { return 29; } return 30; } function hebrewToJd(year, month, day) { var jd = HEBREW_EPOCH + hebrewDelay1(year) + day – 1; var mon; if (month < 7) { for (mon = 7; mon <= hebrewYearMonths(year); mon++) { jd += hebrewMonthDays(year, mon); } for (mon = 1; mon < month; mon++) { jd += hebrewMonthDays(year, mon); } } else { for (mon = 7; mon = hebrewToJd(i, 7, 1); i++) { year++; } var firstDay = hebrewToJd(year, 7, 1); var month; if (jd < firstDay) { firstDay = hebrewToJd(year – 1, 7, 1); year–; } var hMonth, hDay; if (jd < hebrewToJd(year, 1, 1)) { for (month = 7; month <= hebrewYearMonths(year); month++) { var lastDay = hebrewMonthDays(year, month) + hebrewToJd(year, month, 1) – 1; if (jd <= lastDay) { hMonth = month; hDay = jd – hebrewToJd(year, month, 1) + 1; break; } } } else { for (month = 1; month <= hebrewYearMonths(year); month++) { var lastDay = hebrewMonthDays(year, month) + hebrewToJd(year, month, 1) – 1; if (jd 11) hMonth = hMonth – 1; // Shift Shevat/Adar return { year: year, month: hMonth, day: hDay }; } function jdToGregorian(jd) { var wjd = Math.floor(jd – 0.5) + 0.5; var depoch = wjd – GREGORIAN_EPOCH; var quadricent = Math.floor(depoch / 146097); var dqc = depoch % 146097; var cent = Math.floor(dqc / 36524); var dcent = dqc % 36524; var quad = Math.floor(dcent / 1461); var dquad = dcent % 1461; var yindex = Math.floor(dquad / 365); var year = (quadricent * 400) + (cent * 100) + (quad * 4) + yindex; if (!(cent === 4 || yindex === 4)) { year++; } var yearday = wjd – gregorianToJd(year, 1, 1); var leapadj = (wjd < gregorianToJd(year, 3, 1)) ? 0 : (isGregorianLeap(year) ? 1 : 2); var month = Math.floor((((yearday + leapadj) * 12) + 373) / 367); var day = (wjd – gregorianToJd(year, month, 1)) + 1; return { year: year, month: month, day: day }; } function isGregorianLeap(year) { return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); } function gregorianToJd(year, month, day) { var y = year – 1; return GREGORIAN_EPOCH – 1 + (365 * y) + Math.floor(y / 4) – Math.floor(y / 100) + Math.floor(y / 400) + Math.floor((((367 * month) – 362) / 12) + ((month <= 2) ? 0 : (isGregorianLeap(year) ? -1 : -2)) + day); } function getHebrewMonthName(year, month) { if (isHebrewLeap(year)) { if (month === 12) return "Adar"; // This case is tricky, often Adar I is used. if (month === 13) return "Adar I"; if (month === 14) return "Adar II"; } if (month === 12) return "Adar"; if (month === 13) return "Adar"; // Should map to Adar in non-leap var nonLeapMap = [null, "Nisan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Tevet", "Shevat", "Adar"]; var leapMap = [null, "Nisan", "Iyar", "Sivan", "Tammuz", "Av", "Elul", "Tishrei", "Cheshvan", "Kislev", "Tevet", "Shevat", "Adar I", "Adar II"]; return isHebrewLeap(year) ? leapMap[month] : nonLeapMap[month]; } function getHebrewDisplayMonth(year, month) { if (isHebrewLeap(year)) { if (month === 12) return 13; // Adar I if (month === 13) return 14; // Adar II } return month; } function calculateYahrzeit() { var dateString = document.getElementById("dateOfPassing").value; var time = document.getElementById("timeOfPassing").value; var resultDiv = document.getElementById("yahrzeitResult"); if (!dateString) { resultDiv.innerHTML = "Please select a valid date of passing."; return; } var dateParts = dateString.split('-'); var year = parseInt(dateParts[0], 10); var month = parseInt(dateParts[1], 10); var day = parseInt(dateParts[2], 10); if (isNaN(year) || isNaN(month) || isNaN(day)) { resultDiv.innerHTML = "Invalid date format. Please use the date picker."; return; } var passDate = new Date(year, month – 1, day); if (time === 'after') { passDate.setDate(passDate.getDate() + 1); } var passYear = passDate.getFullYear(); var passMonth = passDate.getMonth() + 1; var passDay = passDate.getDate(); var jd = gregorianToJd(passYear, passMonth, passDay); var hebrewDate = jdToHebrew(jd); var hYear = hebrewDate.year; var hMonth = hebrewDate.month; var hDay = hebrewDate.day; // Handle Adar mapping for display var displayMonth = hMonth; if (isHebrewLeap(hYear) && hMonth === 12) { displayMonth = 13; // Adar I } else if (isHebrewLeap(hYear) && hMonth === 13) { displayMonth = 14; // Adar II } else if (!isHebrewLeap(hYear) && hMonth === 13) { displayMonth = 12; // Adar } var hebrewDateString = hDay + " " + getHebrewMonthName(hYear, displayMonth) + ", " + hYear; var output = "

Hebrew Date of Passing

" + hebrewDateString + ""; output += "

Upcoming Yahrzeit Dates (observed on or after sunset)

    "; var currentGregorianYear = new Date().getFullYear(); var startYear = hYear; // Find the next Yahrzeit year var tempJd = hebrewToJd(startYear, hMonth, hDay); var tempGreg = jdToGregorian(tempJd); if (tempGreg.year < currentGregorianYear || (tempGreg.year === currentGregorianYear && tempGreg.month < (new Date().getMonth()+1)) || (tempGreg.year === currentGregorianYear && tempGreg.month === (new Date().getMonth()+1) && tempGreg.day < new Date().getDate())) { startYear++; } for (var i = 0; i < 10; i++) { var yahrzeitYear = startYear + i; var yahrzeitMonth = hMonth; var yahrzeitDay = hDay; // Handle leap year complexities var deathYearIsLeap = isHebrewLeap(hYear); var yahrzeitYearIsLeap = isHebrewLeap(yahrzeitYear); // Death in Adar I (month 12 in leap year) if (deathYearIsLeap && hMonth === 12) { if (!yahrzeitYearIsLeap) { yahrzeitMonth = 12; // Observed in regular Adar } else { yahrzeitMonth = 12; // Observed in Adar I } } // Death in Adar II (month 13 in leap year) else if (deathYearIsLeap && hMonth === 13) { if (!yahrzeitYearIsLeap) { yahrzeitMonth = 12; // Observed in regular Adar } else { yahrzeitMonth = 13; // Observed in Adar II } } // Death in regular Adar (month 12 in non-leap year) else if (!deathYearIsLeap && hMonth === 12) { if (yahrzeitYearIsLeap) { yahrzeitMonth = 13; // Observed in Adar II } else { yahrzeitMonth = 12; // Observed in regular Adar } } // Handle months with variable days (Cheshvan, Kislev) if ((hMonth === 8 || hMonth === 9) && hDay === 30) { if (hebrewMonthDays(yahrzeitYear, yahrzeitMonth) === 29) { yahrzeitDay = 29; } } // Handle 30th of Adar I if (deathYearIsLeap && hMonth === 12 && hDay === 30) { if (!yahrzeitYearIsLeap) { // Yahrzeit is on 1st of Nisan, as regular Adar has 29 days yahrzeitMonth = 1; yahrzeitDay = 1; } } var yahrzeitJd = hebrewToJd(yahrzeitYear, yahrzeitMonth, yahrzeitDay); var gregorianDate = jdToGregorian(yahrzeitJd); var dateObj = new Date(gregorianDate.year, gregorianDate.month – 1, gregorianDate.day); var dayOfWeek = dateObj.toLocaleDateString('en-US', { weekday: 'long' }); var monthName = dateObj.toLocaleDateString('en-US', { month: 'long' }); output += "
  • " + yahrzeitYear + ": " + dayOfWeek + ", " + monthName + " " + gregorianDate.day + ", " + gregorianDate.year + "
  • "; } output += "
"; resultDiv.innerHTML = output; }

Leave a Reply

Your email address will not be published. Required fields are marked *