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.d.cts CHANGED
@@ -28,11 +28,11 @@ declare class Sedra {
28
28
  /**
29
29
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
30
30
  */
31
- toString(): string;
31
+ toString(): string | false;
32
32
  /**
33
33
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
34
34
  */
35
- toStringHeb(): string;
35
+ toStringHeb(): string | false;
36
36
  static lastCalculatedYear: {
37
37
  firstSatInYear: number;
38
38
  sedraArray?: number[];
@@ -484,7 +484,7 @@ declare class Utils {
484
484
  * @param {number} dayOfOmer The day of the Omer for which to get the nusach for
485
485
  * @param {'ashkenaz'|'sefard'|'sefardi'} nusach Should it be La'Omer ("sefard") or Ba'Omer ("ashkenaz") or "sefardi" (Eidot Hamizrach)?
486
486
  */
487
- static getOmerNusach(dayOfOmer: number, nusach: 'ashkenaz' | 'sefard' | 'sefardi'): string;
487
+ static getOmerNusach(dayOfOmer: number, nusach: "ashkenaz" | "sefard" | "sefardi"): string;
488
488
  /**
489
489
  * Returns the given time in a formatted string.
490
490
  * @param {Time} time An object in the format {hour : 23, minute :42, second: 18 }
@@ -569,10 +569,10 @@ declare class Utils {
569
569
  */
570
570
  static toInt(float: number): number;
571
571
  /***
572
- * Takes either a jDate or a Date and returns both
573
- * @param date {Date |jDate}
574
- * @returns {{ sdate:Date, jdate:jDate }}
575
- */
572
+ * Takes either a jDate or a Date and returns both
573
+ * @param date {Date |jDate}
574
+ * @returns {{ sdate:Date, jdate:jDate }}
575
+ */
576
576
  static bothDates(date: Date | jDate): {
577
577
  sdate: Date;
578
578
  jdate: jDate;
package/dist/index.d.ts CHANGED
@@ -28,11 +28,11 @@ declare class Sedra {
28
28
  /**
29
29
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
30
30
  */
31
- toString(): string;
31
+ toString(): string | false;
32
32
  /**
33
33
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
34
34
  */
35
- toStringHeb(): string;
35
+ toStringHeb(): string | false;
36
36
  static lastCalculatedYear: {
37
37
  firstSatInYear: number;
38
38
  sedraArray?: number[];
@@ -484,7 +484,7 @@ declare class Utils {
484
484
  * @param {number} dayOfOmer The day of the Omer for which to get the nusach for
485
485
  * @param {'ashkenaz'|'sefard'|'sefardi'} nusach Should it be La'Omer ("sefard") or Ba'Omer ("ashkenaz") or "sefardi" (Eidot Hamizrach)?
486
486
  */
487
- static getOmerNusach(dayOfOmer: number, nusach: 'ashkenaz' | 'sefard' | 'sefardi'): string;
487
+ static getOmerNusach(dayOfOmer: number, nusach: "ashkenaz" | "sefard" | "sefardi"): string;
488
488
  /**
489
489
  * Returns the given time in a formatted string.
490
490
  * @param {Time} time An object in the format {hour : 23, minute :42, second: 18 }
@@ -569,10 +569,10 @@ declare class Utils {
569
569
  */
570
570
  static toInt(float: number): number;
571
571
  /***
572
- * Takes either a jDate or a Date and returns both
573
- * @param date {Date |jDate}
574
- * @returns {{ sdate:Date, jdate:jDate }}
575
- */
572
+ * Takes either a jDate or a Date and returns both
573
+ * @param date {Date |jDate}
574
+ * @returns {{ sdate:Date, jdate:jDate }}
575
+ */
576
576
  static bothDates(date: Date | jDate): {
577
577
  sdate: Date;
578
578
  jdate: jDate;
package/dist/index.js CHANGED
@@ -148,7 +148,7 @@ var _Sedra = /*#__PURE__*/ function() {
148
148
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
149
149
  */ key: "toString",
150
150
  value: function toString() {
151
- return this.sedras.map(function(s) {
151
+ return this.sedras.length > 0 && this.sedras.map(function(s) {
152
152
  return s.eng;
153
153
  }).join(" - ");
154
154
  }
@@ -158,7 +158,7 @@ var _Sedra = /*#__PURE__*/ function() {
158
158
  * Gets the sedra/s as a string. If there are two, they are seperated by a " - "
159
159
  */ key: "toStringHeb",
160
160
  value: function toStringHeb() {
161
- return this.sedras.map(function(s) {
161
+ return this.sedras.length > 0 && this.sedras.map(function(s) {
162
162
  return s.heb;
163
163
  }).join(" - ");
164
164
  }
@@ -4187,19 +4187,19 @@ var _Utils = /*#__PURE__*/ function() {
4187
4187
  */ function getTimeIntervalTextStringHeb(time) {
4188
4188
  var t = "";
4189
4189
  if (time.hour > 0) {
4190
- t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "\u05E9\u05E2\u05D4" : "\u05E9\u05E2\u05D5\u05EA");
4190
+ t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "\u05E9\u05E2\u05D4" : "\u05E9\u05E2\u05D5\u05EA", "\xad");
4191
4191
  }
4192
4192
  if (time.minute > 0) {
4193
4193
  if (t.length) {
4194
4194
  t += " ";
4195
4195
  }
4196
- t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "\u05D3\u05E7\u05D4" : "\u05D3\u05E7\u05D5\u05EA");
4196
+ t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "\u05D3\u05E7\u05D4" : "\u05D3\u05E7\u05D5\u05EA", "\xad");
4197
4197
  }
4198
4198
  if ((time.second || 0) > 0) {
4199
4199
  if (t.length) {
4200
4200
  t += " ";
4201
4201
  }
4202
- t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "\u05E9\u05E0\u05D9\u05D9\u05D4" : "\u05E9\u05E0\u05D9\u05D5\u05EA");
4202
+ t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "\u05E9\u05E0\u05D9\u05D9\u05D4" : "\u05E9\u05E0\u05D9\u05D5\u05EA", "\xad");
4203
4203
  }
4204
4204
  return t;
4205
4205
  }
@@ -4212,19 +4212,19 @@ var _Utils = /*#__PURE__*/ function() {
4212
4212
  */ function getTimeIntervalTextString(time) {
4213
4213
  var t = "";
4214
4214
  if (time.hour > 0) {
4215
- t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "hour" : "hours");
4215
+ t += "".concat(time.hour.toString(), " ").concat(time.hour === 1 ? "hour" : "hours", "\xad");
4216
4216
  }
4217
4217
  if (time.minute > 0) {
4218
4218
  if (t.length) {
4219
4219
  t += " ";
4220
4220
  }
4221
- t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "minute" : "minutes");
4221
+ t += "".concat(time.minute.toString(), " ").concat(time.minute === 1 ? "minute" : "minutes", "\xad");
4222
4222
  }
4223
4223
  if ((time.second || 0) > 0) {
4224
4224
  if (t.length) {
4225
4225
  t += " ";
4226
4226
  }
4227
- t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "second" : "seconds");
4227
+ t += "".concat(Math.trunc(time.second || 0).toString(), " ").concat(time.second === 1 ? "second" : "seconds", "\xad");
4228
4228
  }
4229
4229
  return t;
4230
4230
  }
@@ -4291,7 +4291,7 @@ var _Utils = /*#__PURE__*/ function() {
4291
4291
  value: /**
4292
4292
  * Returns the given time in a formatted string.
4293
4293
  * @param {Time} time An object in the format {hour : 23, minute :42, second: 18 }
4294
- * @param {1 | -1} [sign]
4294
+ * @param {1 | -1} [sign]
4295
4295
  * @param {Boolean} [army] If falsey, the returned string will be: 11:42:18 PM otherwise it will be 23:42:18
4296
4296
  * @param {Boolean} [roundUp] If falsey, the numbers will converted to a whole number by rounding down, otherwise, up.
4297
4297
  */ function getTimeString(time, sign, army, roundUp) {
@@ -4479,10 +4479,10 @@ var _Utils = /*#__PURE__*/ function() {
4479
4479
  {
4480
4480
  key: "bothDates",
4481
4481
  value: /***
4482
- * Takes either a jDate or a Date and returns both
4483
- * @param date {Date |jDate}
4484
- * @returns {{ sdate:Date, jdate:jDate }}
4485
- */ function bothDates(date) {
4482
+ * Takes either a jDate or a Date and returns both
4483
+ * @param date {Date |jDate}
4484
+ * @returns {{ sdate:Date, jdate:jDate }}
4485
+ */ function bothDates(date) {
4486
4486
  var jdate = _instanceof(date, Date) ? new jDate(date) : date;
4487
4487
  var sdate = _instanceof(date, Date) ? date : jdate.getDate();
4488
4488
  return {
@@ -13454,7 +13454,7 @@ function getNotifications(date, time, location, english, showGaonShir, showDafYo
13454
13454
  var _Utils_bothDates = Utils.bothDates(date), sdate = _Utils_bothDates.sdate, jdate = _Utils_bothDates.jdate;
13455
13455
  dayNotes.length = 0;
13456
13456
  tefillahNotes.length = 0;
13457
- 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);
13457
+ 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);
13458
13458
  dayInfo = {
13459
13459
  jdate: jdate,
13460
13460
  sdate: sdate,
@@ -13514,6 +13514,8 @@ function getShabbosNotifications() {
13514
13514
  addDayNote("Shabbos Shuva", "\u05E9\u05D1\u05EA \u05E9\u05D5\u05D1\u05D4");
13515
13515
  } else if (month === JewishMonthsNames.AV && day > 2 && day < 10) {
13516
13516
  addDayNote("Shabbos Chazon", "\u05E9\u05D1\u05EA \u05D7\u05D6\u05D5\u05DF");
13517
+ } else if (month === JewishMonthsNames.AV && day > 10 && day < 18) {
13518
+ addDayNote("Shabbos Nachamu", "\u05E9\u05D1\u05EA \u05E0\u05D7\u05DE\u05D5");
13517
13519
  } else if (month === (isLeapYear ? JewishMonthsNames.ADAR : JewishMonthsNames.SHVAT) && day > 24 || month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day === 1) {
13518
13520
  addDayNote("Parshas Shkalim", "\u05E4\u05E8\u05E9\u05EA \u05E9\u05E7\u05DC\u05D9\u05DD");
13519
13521
  } else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 7 && day < 14) {
@@ -13523,9 +13525,12 @@ function getShabbosNotifications() {
13523
13525
  } else if (month === (isLeapYear ? JewishMonthsNames.ADAR_SHEINI : JewishMonthsNames.ADAR) && day > 23 && day < 30 || month === JewishMonthsNames.NISSAN && day === 1) {
13524
13526
  addDayNote("Parshas Hachodesh", "\u05E4\u05E8\u05E9\u05EA \u05D4\u05D7\u05D5\u05D3\u05E9");
13525
13527
  }
13526
- if (isMorning && !isYomTov) {
13528
+ if (!isYomTov) {
13527
13529
  var sedra = jdate.getSedra(israel);
13528
- if (sedra.sedras.length > 0) {
13530
+ if (sedra.sedras.length > 0 && sedra.toStringHeb() === "\u05D1\u05E9\u05DC\u05D7") {
13531
+ addDayNote("Shabbos Shira", "\u05E9\u05D1\u05EA \u05E9\u05D9\u05E8\u05D4");
13532
+ }
13533
+ if (isMorning && sedra.sedras.length > 0) {
13529
13534
  addTefillahNote("Kriyas Hatorah Parshas ".concat(sedra.toString()), 'קה"ת פרשת '.concat(sedra.toStringHeb()));
13530
13535
  }
13531
13536
  if (month !== JewishMonthsNames.ELLUL && day > 22 && day < 30) {
@@ -13628,6 +13633,9 @@ function getAroundTheYearNotifications() {
13628
13633
  if (dow !== DaysOfWeek.SHABBOS && day > 15 && day !== 21) {
13629
13634
  addTefillahNote("Vesain Bracha", "\u05D5\u05EA\u05DF \u05D1\u05E8\u05DB\u05D4");
13630
13635
  }
13636
+ if (isNightTime && (dow !== DaysOfWeek.FRIDAY && day === 14 || dow === DaysOfWeek.THURSDAY && day === 13)) {
13637
+ addDayNote("Bedikas Chometz", "\u05D1\u05D3\u05D9\u05E7\u05EA \u05D7\u05DE\u05E5");
13638
+ }
13631
13639
  if (isMorning && dow !== DaysOfWeek.SHABBOS && [
13632
13640
  14,
13633
13641
  16,