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.js CHANGED
@@ -3512,6 +3512,9 @@ var _jDate = /*#__PURE__*/ function() {
3512
3512
  {
3513
3513
  key: "daysJYear",
3514
3514
  value: /**number of days in the given Jewish Year.*/ function daysJYear(year) {
3515
+ if (!year || year < 0) {
3516
+ return 0;
3517
+ }
3515
3518
  if (year >= 5e3) {
3516
3519
  return _jDate.yearType(year).daysInYear;
3517
3520
  } else {
@@ -3522,6 +3525,9 @@ var _jDate = /*#__PURE__*/ function() {
3522
3525
  {
3523
3526
  key: "isLongCheshvan",
3524
3527
  value: /**Does Cheshvan for the given Jewish Year have 30 days?*/ function isLongCheshvan(year) {
3528
+ if (!year || year < 0) {
3529
+ return false;
3530
+ }
3525
3531
  if (year >= 5e3) {
3526
3532
  return _jDate.yearType(year).isLongCheshvan;
3527
3533
  } else {
@@ -3532,6 +3538,9 @@ var _jDate = /*#__PURE__*/ function() {
3532
3538
  {
3533
3539
  key: "isShortKislev",
3534
3540
  value: /**Does Kislev for the given Jewish Year have 29 days?*/ function isShortKislev(year) {
3541
+ if (!year || year < 0) {
3542
+ return false;
3543
+ }
3535
3544
  if (year >= 5e3) {
3536
3545
  return !_jDate.yearType(year).isLongKislev;
3537
3546
  } else {
@@ -13069,8 +13078,9 @@ var Molad = /*#__PURE__*/ function() {
13069
13078
  partsElapsed = 204 + 793 * (totalMonths % 1080);
13070
13079
  hoursElapsed = 5 + 12 * totalMonths + 793 * Utils.toInt(totalMonths / 1080) + Utils.toInt(partsElapsed / 1080) - 6;
13071
13080
  parts = Utils.toInt(partsElapsed % 1080 + 1080 * (hoursElapsed % 24));
13081
+ var absoluteDays = 1 + 29 * Utils.toInt(totalMonths) + Utils.toInt(hoursElapsed / 24) - 1373429;
13072
13082
  return {
13073
- jDate: new jDate(1 + 29 * Utils.toInt(totalMonths) + Utils.toInt(hoursElapsed / 24)),
13083
+ jDate: new jDate(Math.floor(absoluteDays)),
13074
13084
  time: {
13075
13085
  hour: Utils.toInt(hoursElapsed) % 24,
13076
13086
  minute: Utils.toInt(parts % 1080 / 18),