jcal-zmanim 1.5.4 → 1.5.6

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 CHANGED
@@ -3632,6 +3632,9 @@ var _jDate = /*#__PURE__*/ function() {
3632
3632
  {
3633
3633
  key: "daysJYear",
3634
3634
  value: /**number of days in the given Jewish Year.*/ function daysJYear(year) {
3635
+ if (!year || year < 0) {
3636
+ return 0;
3637
+ }
3635
3638
  if (year >= 5e3) {
3636
3639
  return _jDate.yearType(year).daysInYear;
3637
3640
  } else {
@@ -3642,6 +3645,9 @@ var _jDate = /*#__PURE__*/ function() {
3642
3645
  {
3643
3646
  key: "isLongCheshvan",
3644
3647
  value: /**Does Cheshvan for the given Jewish Year have 30 days?*/ function isLongCheshvan(year) {
3648
+ if (!year || year < 0) {
3649
+ return false;
3650
+ }
3645
3651
  if (year >= 5e3) {
3646
3652
  return _jDate.yearType(year).isLongCheshvan;
3647
3653
  } else {
@@ -3652,6 +3658,9 @@ var _jDate = /*#__PURE__*/ function() {
3652
3658
  {
3653
3659
  key: "isShortKislev",
3654
3660
  value: /**Does Kislev for the given Jewish Year have 29 days?*/ function isShortKislev(year) {
3661
+ if (!year || year < 0) {
3662
+ return false;
3663
+ }
3655
3664
  if (year >= 5e3) {
3656
3665
  return !_jDate.yearType(year).isLongKislev;
3657
3666
  } else {
@@ -13185,8 +13194,9 @@ var Molad = /*#__PURE__*/ function() {
13185
13194
  partsElapsed = 204 + 793 * (totalMonths % 1080);
13186
13195
  hoursElapsed = 5 + 12 * totalMonths + 793 * Utils.toInt(totalMonths / 1080) + Utils.toInt(partsElapsed / 1080) - 6;
13187
13196
  parts = Utils.toInt(partsElapsed % 1080 + 1080 * (hoursElapsed % 24));
13197
+ var absoluteDays = 1 + 29 * Utils.toInt(totalMonths) + Utils.toInt(hoursElapsed / 24) - 1373429;
13188
13198
  return {
13189
- jDate: new jDate(1 + 29 * Utils.toInt(totalMonths) + Utils.toInt(hoursElapsed / 24)),
13199
+ jDate: new jDate(Math.floor(absoluteDays)),
13190
13200
  time: {
13191
13201
  hour: Utils.toInt(hoursElapsed) % 24,
13192
13202
  minute: Utils.toInt(parts % 1080 / 18),