jcal-zmanim 1.5.0 → 1.5.1
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 +6 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -8
- package/dist/index.d.ts +1 -8
- package/dist/index.js +6 -52
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -300,8 +300,6 @@ declare class jDate {
|
|
|
300
300
|
static sdFromAbs(abs: number): Date;
|
|
301
301
|
/**number of days in the given Jewish Month. Nissan is 1 and Adar Sheini is 13.*/
|
|
302
302
|
static daysJMonth(year: number, month: number): number;
|
|
303
|
-
/**Elapsed days since creation of the world until Rosh Hashana of the given year*/
|
|
304
|
-
static tDays(year: number): number;
|
|
305
303
|
/**The index for the year type of the given year.
|
|
306
304
|
* IMPORTANT NOTE: Only works for years 5000 and after.
|
|
307
305
|
*/
|
|
@@ -318,16 +316,11 @@ declare class jDate {
|
|
|
318
316
|
static isLongCheshvan(year: number): boolean;
|
|
319
317
|
/**Does Kislev for the given Jewish Year have 29 days?*/
|
|
320
318
|
static isShortKislev(year: number): boolean;
|
|
321
|
-
/**number of days in the given Jewish Year.*/
|
|
322
|
-
static daysJYear_(year: number): number;
|
|
323
|
-
/**Does Cheshvan for the given Jewish Year have 30 days?*/
|
|
324
|
-
static isLongCheshvan_(year: number): boolean;
|
|
325
|
-
/**Does Kislev for the given Jewish Year have 29 days?*/
|
|
326
|
-
static isShortKislev_(year: number): boolean;
|
|
327
319
|
/**Does the given Jewish Year have 13 months?*/
|
|
328
320
|
static isJdLeapY(year: number): boolean;
|
|
329
321
|
/**number of months in Jewish Year.*/
|
|
330
322
|
static monthsJYear(year: number): number;
|
|
323
|
+
static getElapsedDays: (year: number) => number;
|
|
331
324
|
}
|
|
332
325
|
|
|
333
326
|
declare const DaysOfWeek: Readonly<{
|
package/dist/index.d.ts
CHANGED
|
@@ -300,8 +300,6 @@ declare class jDate {
|
|
|
300
300
|
static sdFromAbs(abs: number): Date;
|
|
301
301
|
/**number of days in the given Jewish Month. Nissan is 1 and Adar Sheini is 13.*/
|
|
302
302
|
static daysJMonth(year: number, month: number): number;
|
|
303
|
-
/**Elapsed days since creation of the world until Rosh Hashana of the given year*/
|
|
304
|
-
static tDays(year: number): number;
|
|
305
303
|
/**The index for the year type of the given year.
|
|
306
304
|
* IMPORTANT NOTE: Only works for years 5000 and after.
|
|
307
305
|
*/
|
|
@@ -318,16 +316,11 @@ declare class jDate {
|
|
|
318
316
|
static isLongCheshvan(year: number): boolean;
|
|
319
317
|
/**Does Kislev for the given Jewish Year have 29 days?*/
|
|
320
318
|
static isShortKislev(year: number): boolean;
|
|
321
|
-
/**number of days in the given Jewish Year.*/
|
|
322
|
-
static daysJYear_(year: number): number;
|
|
323
|
-
/**Does Cheshvan for the given Jewish Year have 30 days?*/
|
|
324
|
-
static isLongCheshvan_(year: number): boolean;
|
|
325
|
-
/**Does Kislev for the given Jewish Year have 29 days?*/
|
|
326
|
-
static isShortKislev_(year: number): boolean;
|
|
327
319
|
/**Does the given Jewish Year have 13 months?*/
|
|
328
320
|
static isJdLeapY(year: number): boolean;
|
|
329
321
|
/**number of months in Jewish Year.*/
|
|
330
322
|
static monthsJYear(year: number): number;
|
|
323
|
+
static getElapsedDays: (year: number) => number;
|
|
331
324
|
}
|
|
332
325
|
|
|
333
326
|
declare const DaysOfWeek: Readonly<{
|
package/dist/index.js
CHANGED
|
@@ -1790,7 +1790,6 @@ _Dafyomi.masechtaList = [
|
|
|
1790
1790
|
];
|
|
1791
1791
|
var Dafyomi = _Dafyomi;
|
|
1792
1792
|
// src/JCal/jDate.ts
|
|
1793
|
-
var _yearCache = [];
|
|
1794
1793
|
var JS_START_DATE_ABS = 719163;
|
|
1795
1794
|
var MS_PER_DAY = 864e5;
|
|
1796
1795
|
var JS_START_OFFSET = /* @__PURE__ */ new Date(0).getTimezoneOffset();
|
|
@@ -2896,15 +2895,7 @@ var yearTypeList = [
|
|
|
2896
2895
|
0,
|
|
2897
2896
|
7
|
|
2898
2897
|
];
|
|
2899
|
-
var
|
|
2900
|
-
var getElapsedDaysEarly = function(year) {
|
|
2901
|
-
var _yearCache_find;
|
|
2902
|
-
var elapsed = (_yearCache_find = _yearCache.find(function(y) {
|
|
2903
|
-
return (y === null || y === void 0 ? void 0 : y.year) === year;
|
|
2904
|
-
})) === null || _yearCache_find === void 0 ? void 0 : _yearCache_find.elapsed;
|
|
2905
|
-
if (elapsed) {
|
|
2906
|
-
return elapsed;
|
|
2907
|
-
}
|
|
2898
|
+
var getElapsedDays = function(year) {
|
|
2908
2899
|
var daysCounter = 0;
|
|
2909
2900
|
var months = Utils.toInt(235 * Utils.toInt((year - 1) / 19) + // Leap months this cycle
|
|
2910
2901
|
12 * ((year - 1) % 19) + // Regular months in this cycle.
|
|
@@ -2917,20 +2908,9 @@ var getElapsedDaysEarly = function(year) {
|
|
|
2917
2908
|
if (Utils.has(daysCounter % 7, 0, 3, 5)) {
|
|
2918
2909
|
daysCounter += 1;
|
|
2919
2910
|
}
|
|
2920
|
-
_yearCache.push({
|
|
2921
|
-
year: year,
|
|
2922
|
-
elapsed: daysCounter
|
|
2923
|
-
});
|
|
2924
2911
|
return daysCounter;
|
|
2925
2912
|
};
|
|
2926
|
-
var
|
|
2927
|
-
var counter = daysUntil5000;
|
|
2928
|
-
for(var y = 5e3; y < year; y++){
|
|
2929
|
-
counter += jDate.yearType(y).daysInYear;
|
|
2930
|
-
}
|
|
2931
|
-
return counter;
|
|
2932
|
-
};
|
|
2933
|
-
var jDate = /*#__PURE__*/ function() {
|
|
2913
|
+
var _jDate = /*#__PURE__*/ function() {
|
|
2934
2914
|
"use strict";
|
|
2935
2915
|
function _jDate(arg, month, day, abs) {
|
|
2936
2916
|
_class_call_check(this, _jDate);
|
|
@@ -3478,7 +3458,7 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
3478
3458
|
m1++;
|
|
3479
3459
|
}
|
|
3480
3460
|
}
|
|
3481
|
-
return dayInYear + (
|
|
3461
|
+
return dayInYear + (getElapsedDays(year) + -1373429);
|
|
3482
3462
|
}
|
|
3483
3463
|
},
|
|
3484
3464
|
{
|
|
@@ -3521,16 +3501,6 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
3521
3501
|
return 0;
|
|
3522
3502
|
}
|
|
3523
3503
|
},
|
|
3524
|
-
{
|
|
3525
|
-
key: "tDays",
|
|
3526
|
-
value: /**Elapsed days since creation of the world until Rosh Hashana of the given year*/ function tDays(year) {
|
|
3527
|
-
if (year >= 5e3) {
|
|
3528
|
-
return getElapsedDays5000(year);
|
|
3529
|
-
} else {
|
|
3530
|
-
return getElapsedDaysEarly(year);
|
|
3531
|
-
}
|
|
3532
|
-
}
|
|
3533
|
-
},
|
|
3534
3504
|
{
|
|
3535
3505
|
key: "yearType",
|
|
3536
3506
|
value: /**The index for the year type of the given year.
|
|
@@ -3545,7 +3515,7 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
3545
3515
|
if (year >= 5e3) {
|
|
3546
3516
|
return _jDate.yearType(year).daysInYear;
|
|
3547
3517
|
} else {
|
|
3548
|
-
return
|
|
3518
|
+
return getElapsedDays(year + 1) - getElapsedDays(year);
|
|
3549
3519
|
}
|
|
3550
3520
|
}
|
|
3551
3521
|
},
|
|
@@ -3569,24 +3539,6 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
3569
3539
|
}
|
|
3570
3540
|
}
|
|
3571
3541
|
},
|
|
3572
|
-
{
|
|
3573
|
-
key: "daysJYear_",
|
|
3574
|
-
value: /**number of days in the given Jewish Year.*/ function daysJYear_(year) {
|
|
3575
|
-
return _jDate.yearType(year).daysInYear;
|
|
3576
|
-
}
|
|
3577
|
-
},
|
|
3578
|
-
{
|
|
3579
|
-
key: "isLongCheshvan_",
|
|
3580
|
-
value: /**Does Cheshvan for the given Jewish Year have 30 days?*/ function isLongCheshvan_(year) {
|
|
3581
|
-
return _jDate.yearType(year).isLongCheshvan;
|
|
3582
|
-
}
|
|
3583
|
-
},
|
|
3584
|
-
{
|
|
3585
|
-
key: "isShortKislev_",
|
|
3586
|
-
value: /**Does Kislev for the given Jewish Year have 29 days?*/ function isShortKislev_(year) {
|
|
3587
|
-
return !_jDate.yearType(year).isLongKislev;
|
|
3588
|
-
}
|
|
3589
|
-
},
|
|
3590
3542
|
{
|
|
3591
3543
|
key: "isJdLeapY",
|
|
3592
3544
|
value: /**Does the given Jewish Year have 13 months?*/ function isJdLeapY(year) {
|
|
@@ -3602,6 +3554,8 @@ var jDate = /*#__PURE__*/ function() {
|
|
|
3602
3554
|
]);
|
|
3603
3555
|
return _jDate;
|
|
3604
3556
|
}();
|
|
3557
|
+
_jDate.getElapsedDays = getElapsedDays;
|
|
3558
|
+
var jDate = _jDate;
|
|
3605
3559
|
// src/JCal/Zmanim.ts
|
|
3606
3560
|
var Zmanim = /*#__PURE__*/ function() {
|
|
3607
3561
|
"use strict";
|