jcal-zmanim 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -674
- package/README.md +597 -0
- package/dist/README.md +597 -0
- package/dist/index.cjs +76 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +69 -24
- package/dist/index.js.map +1 -1
- package/package.json +47 -47
package/dist/index.cjs
CHANGED
|
@@ -169,6 +169,9 @@ __export(src_exports, {
|
|
|
169
169
|
JewishMonthsHeb: function() {
|
|
170
170
|
return JewishMonthsHeb;
|
|
171
171
|
},
|
|
172
|
+
JewishMonthsNames: function() {
|
|
173
|
+
return JewishMonthsNames;
|
|
174
|
+
},
|
|
172
175
|
Location: function() {
|
|
173
176
|
return Location;
|
|
174
177
|
},
|
|
@@ -2116,6 +2119,21 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
2116
2119
|
return months;
|
|
2117
2120
|
}
|
|
2118
2121
|
},
|
|
2122
|
+
{
|
|
2123
|
+
/**Gets the number of full months separating this Jewish Date and the given one.
|
|
2124
|
+
* If the given date is before this one, the number will be negative.
|
|
2125
|
+
* @param {jDate} jd
|
|
2126
|
+
* */ key: "diffFullMonths",
|
|
2127
|
+
value: function diffFullMonths(jd) {
|
|
2128
|
+
var months = this.diffMonths(jd);
|
|
2129
|
+
if (months >= 0 && this.Day > jd.Day) {
|
|
2130
|
+
months--;
|
|
2131
|
+
} else if (months < 0 && this.Day < jd.Day) {
|
|
2132
|
+
months++;
|
|
2133
|
+
}
|
|
2134
|
+
return months;
|
|
2135
|
+
}
|
|
2136
|
+
},
|
|
2119
2137
|
{
|
|
2120
2138
|
/**Gets the number of years separating this Jewish Date and the given one.
|
|
2121
2139
|
*
|
|
@@ -2126,7 +2144,25 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
2126
2144
|
* If the given date is before this one, the number will be negative.
|
|
2127
2145
|
* @param {jDate} jd*/ key: "diffYears",
|
|
2128
2146
|
value: function diffYears(jd) {
|
|
2129
|
-
|
|
2147
|
+
var diff = jd.Year - this.Year;
|
|
2148
|
+
if (this.Month < jd.Month || this.Month === jd.Month && this.Day < jd.Day) {
|
|
2149
|
+
diff--;
|
|
2150
|
+
}
|
|
2151
|
+
return diff;
|
|
2152
|
+
}
|
|
2153
|
+
},
|
|
2154
|
+
{
|
|
2155
|
+
/**Gets the number of full years separating this Jewish Date and the given one.
|
|
2156
|
+
* If the given date is before this one, the number will be negative.
|
|
2157
|
+
* @param {jDate} jd*/ key: "diffFullYears",
|
|
2158
|
+
value: function diffFullYears(jd) {
|
|
2159
|
+
var diff = jd.Year - this.Year;
|
|
2160
|
+
if (diff >= 0 && (this.Month > jd.Month || this.Month === jd.Month && this.Day > jd.Day)) {
|
|
2161
|
+
diff--;
|
|
2162
|
+
} else if (diff < 0 && (this.Month < jd.Month || this.Month === jd.Month && this.Day < jd.Day)) {
|
|
2163
|
+
diff++;
|
|
2164
|
+
}
|
|
2165
|
+
return diff;
|
|
2130
2166
|
}
|
|
2131
2167
|
},
|
|
2132
2168
|
{
|
|
@@ -2802,6 +2838,21 @@ var DaysOfWeek = Object.freeze({
|
|
|
2802
2838
|
FRIDAY: 5,
|
|
2803
2839
|
SHABBOS: 6
|
|
2804
2840
|
});
|
|
2841
|
+
var JewishMonthsNames = Object.freeze({
|
|
2842
|
+
NISSAN: 1,
|
|
2843
|
+
IYAR: 2,
|
|
2844
|
+
SIVAN: 3,
|
|
2845
|
+
TAMUZ: 4,
|
|
2846
|
+
AV: 5,
|
|
2847
|
+
ELLUL: 6,
|
|
2848
|
+
TISHREI: 7,
|
|
2849
|
+
CHESHVAN: 8,
|
|
2850
|
+
KISLEV: 9,
|
|
2851
|
+
TEVES: 10,
|
|
2852
|
+
SHVAT: 11,
|
|
2853
|
+
ADAR: 12,
|
|
2854
|
+
ADAR_SHEINI: 13
|
|
2855
|
+
});
|
|
2805
2856
|
var JewishMonthsEng = [
|
|
2806
2857
|
"",
|
|
2807
2858
|
"Nissan",
|
|
@@ -12430,14 +12481,14 @@ function getNotifications(date, time, location, english, showGaonShir, showDafYo
|
|
|
12430
12481
|
addTefillahNote("No Tachnun", 'א"א תחנון');
|
|
12431
12482
|
} else if (isAfternoon) {
|
|
12432
12483
|
addTefillahNote("No Tzidkascha", 'א"א צדקתך');
|
|
12433
|
-
} else if (!(month ===
|
|
12484
|
+
} else if (!(month === JewishMonthsNames.NISSAN && day > 21 || month === JewishMonthsNames.IYAR || month === JewishMonthsNames.SIVAN && day < 6)) {
|
|
12434
12485
|
addTefillahNote("No Av Harachamim", 'א"א אב הרחמים');
|
|
12435
12486
|
}
|
|
12436
12487
|
}
|
|
12437
12488
|
if (showDafYomi !== false) {
|
|
12438
12489
|
addDayNote(jdate.getDafYomi(), jdate.getDafyomiHeb());
|
|
12439
12490
|
}
|
|
12440
|
-
if (isNotBeinHasmashos && (month ===
|
|
12491
|
+
if (isNotBeinHasmashos && (month === JewishMonthsNames.NISSAN && day > 15 || month === JewishMonthsNames.IYAR || month === JewishMonthsNames.SIVAN && day < 6)) {
|
|
12441
12492
|
var dayOfSefirah = jdate.getDayOfOmer();
|
|
12442
12493
|
if (dayOfSefirah > 0) {
|
|
12443
12494
|
addTefillahNote(Utils.getOmerNusach(dayOfSefirah, "ashkenaz"));
|
|
@@ -12450,19 +12501,19 @@ function getNotifications(date, time, location, english, showGaonShir, showDafYo
|
|
|
12450
12501
|
}
|
|
12451
12502
|
function getShabbosNotifications() {
|
|
12452
12503
|
var month = dayInfo.month, day = dayInfo.day, isLeapYear = dayInfo.isLeapYear, isMorning = dayInfo.isMorning, isYomTov = dayInfo.isYomTov, jdate = dayInfo.jdate, isDaytime = dayInfo.isDaytime, isAfternoon = dayInfo.isAfternoon;
|
|
12453
|
-
if (month ===
|
|
12504
|
+
if (month === JewishMonthsNames.NISSAN && day > 7 && day < 15) {
|
|
12454
12505
|
addDayNote("Shabbos Hagadol", "שבת הגדול");
|
|
12455
|
-
} else if (month ===
|
|
12506
|
+
} else if (month === JewishMonthsNames.TISHREI && day > 2 && day < 10) {
|
|
12456
12507
|
addDayNote("Shabbos Shuva", "שבת שובה");
|
|
12457
|
-
} else if (month ===
|
|
12508
|
+
} else if (month === JewishMonthsNames.AV && day > 2 && day < 10) {
|
|
12458
12509
|
addDayNote("Shabbos Chazon", "שבת חזון");
|
|
12459
|
-
} else if (month === (isLeapYear ?
|
|
12510
|
+
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR : JewishMonthsNames.SHVAT) && day > 24 || month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day === 1) {
|
|
12460
12511
|
addDayNote("Parshas Shkalim", "פרשת שקלים");
|
|
12461
|
-
} else if (month === (isLeapYear ?
|
|
12512
|
+
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 7 && day < 14) {
|
|
12462
12513
|
addDayNote("Parshas Zachor", "פרשת זכור");
|
|
12463
|
-
} else if (month === (isLeapYear ?
|
|
12514
|
+
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 16 && day < 24) {
|
|
12464
12515
|
addDayNote("Parshas Parah", "פרשת פרה");
|
|
12465
|
-
} else if (month === (isLeapYear ?
|
|
12516
|
+
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 23 && day < 30 || month === JewishMonthsNames.NISSAN && day === 1) {
|
|
12466
12517
|
addDayNote("Parshas Hachodesh", "פרשת החודש");
|
|
12467
12518
|
}
|
|
12468
12519
|
if (isMorning && !isYomTov) {
|
|
@@ -12470,22 +12521,22 @@ function getShabbosNotifications() {
|
|
|
12470
12521
|
if (sedra.sedras.length > 0) {
|
|
12471
12522
|
addTefillahNote("Kriyas Hatorah Parshas ".concat(sedra.toString()), 'קה"ת פרשת '.concat(sedra.toStringHeb()));
|
|
12472
12523
|
}
|
|
12473
|
-
if (month !==
|
|
12524
|
+
if (month !== JewishMonthsNames.ELLUL && day > 22 && day < 30) {
|
|
12474
12525
|
var nextMonth = jdate.addMonths(1);
|
|
12475
12526
|
addTefillahNote("The molad will be " + Molad.getString(nextMonth.Year, nextMonth.Month), "המולד יהיה ב" + Molad.getStringHeb(nextMonth.Year, nextMonth.Month));
|
|
12476
12527
|
addTefillahNote("Bircas Hachodesh", "מברכים החודש");
|
|
12477
|
-
if (month !==
|
|
12528
|
+
if (month !== JewishMonthsNames.NISSAN && month !== JewishMonthsNames.IYAR) {
|
|
12478
12529
|
addTefillahNote("No Av Harachamim", 'א"א אב הרחמים');
|
|
12479
12530
|
}
|
|
12480
12531
|
}
|
|
12481
12532
|
}
|
|
12482
|
-
if (month !==
|
|
12533
|
+
if (month !== JewishMonthsNames.TISHREI && (day === 1 || day === 30)) {
|
|
12483
12534
|
addDayNote("Rosh Chodesh", "ראש חודש");
|
|
12484
12535
|
addTefillahNote("Ya`aleh Viyavo", "יעלה ויבא");
|
|
12485
12536
|
if (showGaonShirShelYom && isDaytime) {
|
|
12486
12537
|
addTefillahNote("Barchi Nafshi", 'שיר של יום - קי"ד - ברכי נפשי');
|
|
12487
12538
|
}
|
|
12488
|
-
if (isDaytime && month !==
|
|
12539
|
+
if (isDaytime && month !== JewishMonthsNames.TEVES && !(month === JewishMonthsNames.KISLEV && day === 30)) {
|
|
12489
12540
|
addTefillahNote("Chatzi Hallel", "חצי הלל");
|
|
12490
12541
|
}
|
|
12491
12542
|
addTefillahNote("No Av Harachamim", 'א"א אב הרחמים');
|
|
@@ -12495,11 +12546,11 @@ function getShabbosNotifications() {
|
|
|
12495
12546
|
addTefillahNote("שיר של יום - מזמור שיר ליום השבת");
|
|
12496
12547
|
}
|
|
12497
12548
|
}
|
|
12498
|
-
if (isAfternoon && !(month ===
|
|
12549
|
+
if (isAfternoon && !(month === JewishMonthsNames.TISHREI && day === 10)) {
|
|
12499
12550
|
var sedra1 = jdate.addDays(1).getSedra(israel);
|
|
12500
12551
|
addTefillahNote("Kriyas Hatorah Mincha Parshas " + sedra1.sedras[0].eng, 'קה"ת במנחה פרשת ' + sedra1.sedras[0].heb);
|
|
12501
12552
|
}
|
|
12502
|
-
if (isAfternoon && (month ===
|
|
12553
|
+
if (isAfternoon && (month === JewishMonthsNames.NISSAN && day > 21 || month <= JewishMonthsNames.ELLUL && !(month === JewishMonthsNames.AV && [
|
|
12503
12554
|
8,
|
|
12504
12555
|
9
|
|
12505
12556
|
].includes(day)))) {
|
|
@@ -12516,11 +12567,11 @@ function getShabbosNotifications() {
|
|
|
12516
12567
|
function getWeekDayNotifications() {
|
|
12517
12568
|
var isNightTime = dayInfo.isNightTime, dow = dayInfo.dow, isYomTov = dayInfo.isYomTov, month = dayInfo.month, day = dayInfo.day, isMorning = dayInfo.isMorning, jdate = dayInfo.jdate, location = dayInfo.location, isDaytime = dayInfo.isDaytime, isAfternoon = dayInfo.isAfternoon;
|
|
12518
12569
|
if (isNightTime && dow === DaysOfWeek.SUNDAY) {
|
|
12519
|
-
addTefillahNote(month ===
|
|
12520
|
-
if (month ===
|
|
12570
|
+
addTefillahNote(month === JewishMonthsNames.NISSAN && day === 15 || month === JewishMonthsNames.SIVAN && day === 6 ? "ותודיעינו" : "אתה חוננתנו");
|
|
12571
|
+
if (month === JewishMonthsNames.ELLUL && day > 22 || month === JewishMonthsNames.TISHREI && day < 22 && day !== 3 || month === JewishMonthsNames.NISSAN && day > 8 && day < 15 || month === JewishMonthsNames.SIVAN && day < 6) {
|
|
12521
12572
|
addTefillahNote("No Vihi Noam", 'א"א ויהי נועם');
|
|
12522
12573
|
}
|
|
12523
|
-
} else if (isNightTime && (month ===
|
|
12574
|
+
} else if (isNightTime && (month === JewishMonthsNames.NISSAN && (day === 16 || day === 22) || month === JewishMonthsNames.SIVAN && day === 7 || month === JewishMonthsNames.TISHREI && [
|
|
12524
12575
|
3,
|
|
12525
12576
|
11,
|
|
12526
12577
|
16,
|
|
@@ -12534,20 +12585,20 @@ function getWeekDayNotifications() {
|
|
|
12534
12585
|
addTefillahNote("Kriyas Hatorah Parshas ".concat(sedra.sedras[0].eng), 'קה"ת פרשת '.concat(sedra.sedras[0].heb));
|
|
12535
12586
|
}
|
|
12536
12587
|
}
|
|
12537
|
-
if (month !==
|
|
12588
|
+
if (month !== JewishMonthsNames.TISHREI && day === 1 || day === 30) {
|
|
12538
12589
|
dayInfo.noTachnun = true;
|
|
12539
12590
|
addDayNote("Rosh Chodesh", "ראש חודש");
|
|
12540
12591
|
addTefillahNote("Ya`aleh Viyavo", "יעלה ויבא");
|
|
12541
12592
|
if (showGaonShirShelYom && isDaytime) {
|
|
12542
12593
|
addTefillahNote("Barchi Nafshi", 'שיר של יום - קי"ד - ברכי נפשי');
|
|
12543
12594
|
}
|
|
12544
|
-
if (isDaytime && month !==
|
|
12595
|
+
if (isDaytime && month !== JewishMonthsNames.TEVES && !(month === JewishMonthsNames.KISLEV && day === 30)) {
|
|
12545
12596
|
addTefillahNote("Chatzi Hallel", "חצי הלל");
|
|
12546
12597
|
if (isMorning && dow !== DaysOfWeek.SHABBOS) {
|
|
12547
12598
|
noLaminatzeach();
|
|
12548
12599
|
}
|
|
12549
12600
|
}
|
|
12550
|
-
} else if (month !==
|
|
12601
|
+
} else if (month !== JewishMonthsNames.ELLUL && (dow < DaysOfWeek.FRIDAY && day === 29 || dow === DaysOfWeek.THURSDAY && day === 28) && isAfternoon) {
|
|
12551
12602
|
addTefillahNote("Yom Kippur Kattan", 'יו"כ קטן');
|
|
12552
12603
|
}
|
|
12553
12604
|
if (jdate.hasEiruvTavshilin(israel)) {
|
|
@@ -13116,7 +13167,7 @@ function getAroundTheYearNotifications() {
|
|
|
13116
13167
|
break;
|
|
13117
13168
|
case 12:
|
|
13118
13169
|
case 13:
|
|
13119
|
-
if (month ===
|
|
13170
|
+
if (month === JewishMonthsNames.ADAR && isLeapYear) {
|
|
13120
13171
|
if ((day === 13 && isAfternoon || [
|
|
13121
13172
|
14,
|
|
13122
13173
|
15
|
|
@@ -13239,7 +13290,7 @@ function hasOwnKriyasHatorah(jdate, location) {
|
|
|
13239
13290
|
return Day === 10 || Day < 3 || Day === 3 && jDate.isShortKislev(jdate.Year);
|
|
13240
13291
|
case 12:
|
|
13241
13292
|
case 13:
|
|
13242
|
-
return Month === (jDate.isJdLeapY(jdate.Year) ?
|
|
13293
|
+
return Month === (jDate.isJdLeapY(jdate.Year) ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && (Day === 13 || Day === (location.Name === "ירושלים" ? 15 : 14));
|
|
13243
13294
|
default:
|
|
13244
13295
|
return false;
|
|
13245
13296
|
}
|
|
@@ -13252,6 +13303,7 @@ function hasOwnKriyasHatorah(jdate, location) {
|
|
|
13252
13303
|
DaysOfWeekHeb: DaysOfWeekHeb,
|
|
13253
13304
|
JewishMonthsEng: JewishMonthsEng,
|
|
13254
13305
|
JewishMonthsHeb: JewishMonthsHeb,
|
|
13306
|
+
JewishMonthsNames: JewishMonthsNames,
|
|
13255
13307
|
Location: Location,
|
|
13256
13308
|
Locations: Locations,
|
|
13257
13309
|
Molad: Molad,
|