jcal-zmanim 1.5.1 → 1.5.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/dist/index.cjs +27 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -153,8 +153,8 @@ var __toCommonJS = function(mod) {
|
|
|
153
153
|
}), mod);
|
|
154
154
|
};
|
|
155
155
|
// src/index.ts
|
|
156
|
-
var
|
|
157
|
-
__export(
|
|
156
|
+
var index_exports = {};
|
|
157
|
+
__export(index_exports, {
|
|
158
158
|
Dafyomi: function() {
|
|
159
159
|
return Dafyomi;
|
|
160
160
|
},
|
|
@@ -228,7 +228,7 @@ __export(src_exports, {
|
|
|
228
228
|
return jDate;
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
|
-
module.exports = __toCommonJS(
|
|
231
|
+
module.exports = __toCommonJS(index_exports);
|
|
232
232
|
// src/JCal/Sedra.ts
|
|
233
233
|
var _Sedra = /*#__PURE__*/ function() {
|
|
234
234
|
function _Sedra(jd, israel2) {
|
|
@@ -271,7 +271,7 @@ var _Sedra = /*#__PURE__*/ function() {
|
|
|
271
271
|
* Gets the sedra/s as a string. If there are two, they are seperated by a " - "
|
|
272
272
|
*/ key: "toString",
|
|
273
273
|
value: function toString() {
|
|
274
|
-
return this.sedras.map(function(s) {
|
|
274
|
+
return this.sedras.length > 0 && this.sedras.map(function(s) {
|
|
275
275
|
return s.eng;
|
|
276
276
|
}).join(" - ");
|
|
277
277
|
}
|
|
@@ -281,7 +281,7 @@ var _Sedra = /*#__PURE__*/ function() {
|
|
|
281
281
|
* Gets the sedra/s as a string. If there are two, they are seperated by a " - "
|
|
282
282
|
*/ key: "toStringHeb",
|
|
283
283
|
value: function toStringHeb() {
|
|
284
|
-
return this.sedras.map(function(s) {
|
|
284
|
+
return this.sedras.length > 0 && this.sedras.map(function(s) {
|
|
285
285
|
return s.heb;
|
|
286
286
|
}).join(" - ");
|
|
287
287
|
}
|
|
@@ -4305,19 +4305,19 @@ var _Utils = /*#__PURE__*/ function() {
|
|
|
4305
4305
|
*/ function getTimeIntervalTextStringHeb(time) {
|
|
4306
4306
|
var t = "";
|
|
4307
4307
|
if (time.hour > 0) {
|
|
4308
|
-
t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "\u05E9\u05E2\u05D4" : "\u05E9\u05E2\u05D5\u05EA");
|
|
4308
|
+
t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "\u05E9\u05E2\u05D4" : "\u05E9\u05E2\u05D5\u05EA", "\xad");
|
|
4309
4309
|
}
|
|
4310
4310
|
if (time.minute > 0) {
|
|
4311
4311
|
if (t.length) {
|
|
4312
4312
|
t += " ";
|
|
4313
4313
|
}
|
|
4314
|
-
t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "\u05D3\u05E7\u05D4" : "\u05D3\u05E7\u05D5\u05EA");
|
|
4314
|
+
t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "\u05D3\u05E7\u05D4" : "\u05D3\u05E7\u05D5\u05EA", "\xad");
|
|
4315
4315
|
}
|
|
4316
4316
|
if ((time.second || 0) > 0) {
|
|
4317
4317
|
if (t.length) {
|
|
4318
4318
|
t += " ";
|
|
4319
4319
|
}
|
|
4320
|
-
t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "\u05E9\u05E0\u05D9\u05D9\u05D4" : "\u05E9\u05E0\u05D9\u05D5\u05EA");
|
|
4320
|
+
t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "\u05E9\u05E0\u05D9\u05D9\u05D4" : "\u05E9\u05E0\u05D9\u05D5\u05EA", "\xad");
|
|
4321
4321
|
}
|
|
4322
4322
|
return t;
|
|
4323
4323
|
}
|
|
@@ -4330,19 +4330,19 @@ var _Utils = /*#__PURE__*/ function() {
|
|
|
4330
4330
|
*/ function getTimeIntervalTextString(time) {
|
|
4331
4331
|
var t = "";
|
|
4332
4332
|
if (time.hour > 0) {
|
|
4333
|
-
t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "hour" : "hours");
|
|
4333
|
+
t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "hour" : "hours", "\xad");
|
|
4334
4334
|
}
|
|
4335
4335
|
if (time.minute > 0) {
|
|
4336
4336
|
if (t.length) {
|
|
4337
4337
|
t += " ";
|
|
4338
4338
|
}
|
|
4339
|
-
t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "minute" : "minutes");
|
|
4339
|
+
t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "minute" : "minutes", "\xad");
|
|
4340
4340
|
}
|
|
4341
4341
|
if ((time.second || 0) > 0) {
|
|
4342
4342
|
if (t.length) {
|
|
4343
4343
|
t += " ";
|
|
4344
4344
|
}
|
|
4345
|
-
t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "second" : "seconds");
|
|
4345
|
+
t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "second" : "seconds", "\xad");
|
|
4346
4346
|
}
|
|
4347
4347
|
return t;
|
|
4348
4348
|
}
|
|
@@ -4409,7 +4409,7 @@ var _Utils = /*#__PURE__*/ function() {
|
|
|
4409
4409
|
value: /**
|
|
4410
4410
|
* Returns the given time in a formatted string.
|
|
4411
4411
|
* @param {Time} time An object in the format {hour : 23, minute :42, second: 18 }
|
|
4412
|
-
* @param {1 | -1} [sign]
|
|
4412
|
+
* @param {1 | -1} [sign]
|
|
4413
4413
|
* @param {Boolean} [army] If falsey, the returned string will be: 11:42:18 PM otherwise it will be 23:42:18
|
|
4414
4414
|
* @param {Boolean} [roundUp] If falsey, the numbers will converted to a whole number by rounding down, otherwise, up.
|
|
4415
4415
|
*/ function getTimeString(time, sign, army, roundUp) {
|
|
@@ -4597,10 +4597,10 @@ var _Utils = /*#__PURE__*/ function() {
|
|
|
4597
4597
|
{
|
|
4598
4598
|
key: "bothDates",
|
|
4599
4599
|
value: /***
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4600
|
+
* Takes either a jDate or a Date and returns both
|
|
4601
|
+
* @param date {Date |jDate}
|
|
4602
|
+
* @returns {{ sdate:Date, jdate:jDate }}
|
|
4603
|
+
*/ function bothDates(date) {
|
|
4604
4604
|
var jdate = _instanceof(date, Date) ? new jDate(date) : date;
|
|
4605
4605
|
var sdate = _instanceof(date, Date) ? date : jdate.getDate();
|
|
4606
4606
|
return {
|
|
@@ -13569,7 +13569,7 @@ function getNotifications(date, time, location, english, showGaonShir, showDafYo
|
|
|
13569
13569
|
var _Utils_bothDates = Utils.bothDates(date), sdate = _Utils_bothDates.sdate, jdate = _Utils_bothDates.jdate;
|
|
13570
13570
|
dayNotes.length = 0;
|
|
13571
13571
|
tefillahNotes.length = 0;
|
|
13572
|
-
var month = jdate.Month, day = jdate.Day, dow = jdate.DayOfWeek, _ZmanimUtils_getBasicShulZmanim = ZmanimUtils.getBasicShulZmanim(date, location), chatzosHayom = _ZmanimUtils_getBasicShulZmanim.chatzosHayom, chatzosHalayla = _ZmanimUtils_getBasicShulZmanim.chatzosHalayla, alos = _ZmanimUtils_getBasicShulZmanim.alos, shkia = _ZmanimUtils_getBasicShulZmanim.shkia, isAfterChatzosHayom = Utils.isTimeAfter(chatzosHayom, time), isAfterChatzosHalayla = typeof chatzosHalayla !== "undefined" && (Utils.isTimeAfter(chatzosHalayla, time) || chatzosHalayla.hour > 12 && time.hour < 12), isAfterAlos = Utils.isTimeAfter(alos, time), isAfterShkia = Utils.isTimeAfter(shkia, time), isDaytime = isAfterAlos && !isAfterShkia, isNightTime = !isDaytime, isNotBeinHasmashos = !isAfterShkia || Utils.isTimeAfter(Utils.addMinutes(shkia, 18), time), isMorning = isDaytime && !isAfterChatzosHayom, isAfternoon = isDaytime && isAfterChatzosHayom, isYomTov = jdate.isYomTovOrCholHamoed(location.Israel), isLeapYear = jDate.isJdLeapY(jdate.Year), noTachnun = isAfternoon && (dow === DaysOfWeek.FRIDAY || day === 29);
|
|
13572
|
+
var month = jdate.Month, day = jdate.Day, dow = jdate.DayOfWeek, _ZmanimUtils_getBasicShulZmanim = ZmanimUtils.getBasicShulZmanim(date, location), chatzosHayom = _ZmanimUtils_getBasicShulZmanim.chatzosHayom, chatzosHalayla = _ZmanimUtils_getBasicShulZmanim.chatzosHalayla, alos = _ZmanimUtils_getBasicShulZmanim.alos, shkia = _ZmanimUtils_getBasicShulZmanim.shkia, isAfterChatzosHayom = Utils.isTimeAfter(chatzosHayom, time), isAfterChatzosHalayla = typeof chatzosHalayla !== "undefined" && (Utils.isTimeAfter(chatzosHalayla, time) || chatzosHalayla.hour > 12 && time.hour < 12), isAfterAlos = Utils.isTimeAfter(alos, time), isAfterShkia = Utils.isTimeAfter(shkia, time), isDaytime = isAfterAlos && !isAfterShkia, isNightTime = !isDaytime, isNotBeinHasmashos = !isAfterShkia || Utils.isTimeAfter(Utils.addMinutes(shkia, 18), time), isMorning = isDaytime && !isAfterChatzosHayom, isAfternoon = isDaytime && isAfterChatzosHayom && isNotBeinHasmashos, isYomTov = jdate.isYomTovOrCholHamoed(location.Israel), isLeapYear = jDate.isJdLeapY(jdate.Year), noTachnun = isAfternoon && (dow === DaysOfWeek.FRIDAY || day === 29);
|
|
13573
13573
|
dayInfo = {
|
|
13574
13574
|
jdate: jdate,
|
|
13575
13575
|
sdate: sdate,
|
|
@@ -13629,6 +13629,8 @@ function getShabbosNotifications() {
|
|
|
13629
13629
|
addDayNote("Shabbos Shuva", "\u05E9\u05D1\u05EA \u05E9\u05D5\u05D1\u05D4");
|
|
13630
13630
|
} else if (month === JewishMonthsNames.AV && day > 2 && day < 10) {
|
|
13631
13631
|
addDayNote("Shabbos Chazon", "\u05E9\u05D1\u05EA \u05D7\u05D6\u05D5\u05DF");
|
|
13632
|
+
} else if (month === JewishMonthsNames.AV && day > 10 && day < 18) {
|
|
13633
|
+
addDayNote("Shabbos Nachamu", "\u05E9\u05D1\u05EA \u05E0\u05D7\u05DE\u05D5");
|
|
13632
13634
|
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR : JewishMonthsNames.SHVAT) && day > 24 || month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day === 1) {
|
|
13633
13635
|
addDayNote("Parshas Shkalim", "\u05E4\u05E8\u05E9\u05EA \u05E9\u05E7\u05DC\u05D9\u05DD");
|
|
13634
13636
|
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 7 && day < 14) {
|
|
@@ -13638,9 +13640,12 @@ function getShabbosNotifications() {
|
|
|
13638
13640
|
} else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 23 && day < 30 || month === JewishMonthsNames.NISSAN && day === 1) {
|
|
13639
13641
|
addDayNote("Parshas Hachodesh", "\u05E4\u05E8\u05E9\u05EA \u05D4\u05D7\u05D5\u05D3\u05E9");
|
|
13640
13642
|
}
|
|
13641
|
-
if (
|
|
13643
|
+
if (!isYomTov) {
|
|
13642
13644
|
var sedra = jdate.getSedra(israel);
|
|
13643
|
-
if (sedra.sedras.length > 0) {
|
|
13645
|
+
if (sedra.sedras.length > 0 && sedra.toStringHeb() === "\u05D1\u05E9\u05DC\u05D7") {
|
|
13646
|
+
addDayNote("Shabbos Shira", "\u05E9\u05D1\u05EA \u05E9\u05D9\u05E8\u05D4");
|
|
13647
|
+
}
|
|
13648
|
+
if (isMorning && sedra.sedras.length > 0) {
|
|
13644
13649
|
addTefillahNote("Kriyas Hatorah Parshas ".concat(sedra.toString()), 'קה"ת פרשת '.concat(sedra.toStringHeb()));
|
|
13645
13650
|
}
|
|
13646
13651
|
if (month !== JewishMonthsNames.ELLUL && day > 22 && day < 30) {
|
|
@@ -13743,6 +13748,9 @@ function getAroundTheYearNotifications() {
|
|
|
13743
13748
|
if (dow !== DaysOfWeek.SHABBOS && day > 15 && day !== 21) {
|
|
13744
13749
|
addTefillahNote("Vesain Bracha", "\u05D5\u05EA\u05DF \u05D1\u05E8\u05DB\u05D4");
|
|
13745
13750
|
}
|
|
13751
|
+
if (isNightTime && (dow !== DaysOfWeek.FRIDAY && day === 14 || dow === DaysOfWeek.THURSDAY && day === 13)) {
|
|
13752
|
+
addDayNote("Bedikas Chometz", "\u05D1\u05D3\u05D9\u05E7\u05EA \u05D7\u05DE\u05E5");
|
|
13753
|
+
}
|
|
13746
13754
|
if (isMorning && dow !== DaysOfWeek.SHABBOS && [
|
|
13747
13755
|
14,
|
|
13748
13756
|
16,
|