Last active
February 2, 2022 19:46
-
-
Save ayal/bd9d2168874b9ff4e251ff4d98f94d0e to your computer and use it in GitHub Desktop.
hebrew date match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HDate } from '@hebcal/core'; | |
const month = 1; // feb, zero based (so 0=jan, 1=feb etc..) | |
const day = 2; | |
const time = 13; | |
const year = 1984; | |
for (let i = 0; i < 120; i++) { | |
const loazi_date = new Date(year+i, month, day, time) // 02/02/198X 13:00 | |
const hebrew_date = new HDate(loazi_date); | |
if (hebrew_date.render().indexOf(`29th of Sh'vat`) !== -1) { | |
console.log('date match!', loazi_date.toDateString()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HDate } from '@hebcal/core'; | |
const month = 6; | |
const day = 20; | |
const time = 13; | |
const year = 1978; | |
const loazi_date = new Date(year, month, day, time) | |
const hebrew_date = new HDate(loazi_date); | |
console.log('original date:', hebrew_date.render()); | |
for (let i = 0; i < 120; i++) { | |
const loazi_date = new Date(year+i, month, day, time) | |
const hebrew_date = new HDate(loazi_date); | |
if (hebrew_date.render().indexOf(`15th of Tamuz`) !== -1) { | |
console.log(`date match after ${i} years`, loazi_date.toDateString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment