@hebcal/core 5.3.2 → 5.3.4
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/bundle.js +270 -250
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +699 -725
- package/dist/index.mjs +699 -725
- package/package.json +6 -6
package/dist/bundle.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/*! @hebcal/core v5.3.
|
|
1
|
+
/*! @hebcal/core v5.3.4 */
|
|
2
2
|
var hebcal = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
|
|
5
6
|
/** @private */
|
|
6
7
|
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
7
8
|
/** @private */
|
|
@@ -19,6 +20,22 @@ function mod$1(x, y) {
|
|
|
19
20
|
function quotient(x, y) {
|
|
20
21
|
return Math.floor(x / y);
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* @private
|
|
25
|
+
* @param abs - R.D. number of days
|
|
26
|
+
*/
|
|
27
|
+
function yearFromFixed(abs) {
|
|
28
|
+
const l0 = abs - 1;
|
|
29
|
+
const n400 = quotient(l0, 146097);
|
|
30
|
+
const d1 = mod$1(l0, 146097);
|
|
31
|
+
const n100 = quotient(d1, 36524);
|
|
32
|
+
const d2 = mod$1(d1, 36524);
|
|
33
|
+
const n4 = quotient(d2, 1461);
|
|
34
|
+
const d3 = mod$1(d2, 1461);
|
|
35
|
+
const n1 = quotient(d3, 365);
|
|
36
|
+
const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
37
|
+
return n100 !== 4 && n1 !== 4 ? year + 1 : year;
|
|
38
|
+
}
|
|
22
39
|
/*
|
|
23
40
|
const ABS_14SEP1752 = 639797;
|
|
24
41
|
const ABS_2SEP1752 = 639785;
|
|
@@ -54,25 +71,10 @@ exports.greg = void 0;
|
|
|
54
71
|
* @return {boolean}
|
|
55
72
|
*/
|
|
56
73
|
function isDate(obj) {
|
|
74
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
57
75
|
return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);
|
|
58
76
|
}
|
|
59
77
|
greg.isDate = isDate;
|
|
60
|
-
/**
|
|
61
|
-
* @private
|
|
62
|
-
* @param abs - R.D. number of days
|
|
63
|
-
*/
|
|
64
|
-
function yearFromFixed(abs) {
|
|
65
|
-
const l0 = abs - 1;
|
|
66
|
-
const n400 = quotient(l0, 146097);
|
|
67
|
-
const d1 = mod$1(l0, 146097);
|
|
68
|
-
const n100 = quotient(d1, 36524);
|
|
69
|
-
const d2 = mod$1(d1, 36524);
|
|
70
|
-
const n4 = quotient(d2, 1461);
|
|
71
|
-
const d3 = mod$1(d2, 1461);
|
|
72
|
-
const n1 = quotient(d3, 365);
|
|
73
|
-
const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
|
|
74
|
-
return n100 != 4 && n1 != 4 ? year + 1 : year;
|
|
75
|
-
}
|
|
76
78
|
/**
|
|
77
79
|
* @private
|
|
78
80
|
* @param year
|
|
@@ -183,7 +185,7 @@ const months = {
|
|
|
183
185
|
/** Adar Sheini (only on leap years) / אדר ב׳ */
|
|
184
186
|
ADAR_II: 13
|
|
185
187
|
};
|
|
186
|
-
const monthNames0 = ['', 'Nisan', 'Iyyar', 'Sivan', 'Tamuz', 'Av', 'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Tevet',
|
|
188
|
+
const monthNames0 = ['', 'Nisan', 'Iyyar', 'Sivan', 'Tamuz', 'Av', 'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Tevet', "Sh'vat"];
|
|
187
189
|
/**
|
|
188
190
|
* Transliterations of Hebrew month names.
|
|
189
191
|
* Regular years are index 0 and leap years are index 1.
|
|
@@ -427,7 +429,7 @@ function monthFromName(monthName) {
|
|
|
427
429
|
switch (c[0]) {
|
|
428
430
|
case 'n':
|
|
429
431
|
case 'נ':
|
|
430
|
-
if (c[1]
|
|
432
|
+
if (c[1] === 'o') {
|
|
431
433
|
break; /* this catches "november" */
|
|
432
434
|
}
|
|
433
435
|
return months.NISAN;
|
|
@@ -512,7 +514,7 @@ const SHVAT = months.SHVAT;
|
|
|
512
514
|
const ADAR_I$1 = months.ADAR_I;
|
|
513
515
|
const ADAR_II$1 = months.ADAR_II;
|
|
514
516
|
/**
|
|
515
|
-
* Returns true if the object is a
|
|
517
|
+
* Returns true if the object is a SimpleHebrewDate
|
|
516
518
|
* @private
|
|
517
519
|
* @param {Object} obj
|
|
518
520
|
*/
|
|
@@ -540,18 +542,18 @@ function getYahrzeitHD(hyear, date) {
|
|
|
540
542
|
// Hebrew year ${hyear} occurs on or before original date in ${hDeath.yy}
|
|
541
543
|
return undefined;
|
|
542
544
|
}
|
|
543
|
-
if (hDeath.mm
|
|
545
|
+
if (hDeath.mm === CHESHVAN && hDeath.dd === 30 && !longCheshvan(hDeath.yy + 1)) {
|
|
544
546
|
// If it's Heshvan 30 it depends on the first anniversary;
|
|
545
547
|
// if that was not Heshvan 30, use the day before Kislev 1.
|
|
546
548
|
hDeath = abs2hebrew(hebrew2abs(hyear, KISLEV$1, 1) - 1);
|
|
547
|
-
} else if (hDeath.mm
|
|
549
|
+
} else if (hDeath.mm === KISLEV$1 && hDeath.dd === 30 && shortKislev(hDeath.yy + 1)) {
|
|
548
550
|
// If it's Kislev 30 it depends on the first anniversary;
|
|
549
551
|
// if that was not Kislev 30, use the day before Teveth 1.
|
|
550
552
|
hDeath = abs2hebrew(hebrew2abs(hyear, TEVET$1, 1) - 1);
|
|
551
|
-
} else if (hDeath.mm
|
|
553
|
+
} else if (hDeath.mm === ADAR_II$1) {
|
|
552
554
|
// If it's Adar II, use the same day in last month of year (Adar or Adar II).
|
|
553
555
|
hDeath.mm = monthsInYear(hyear);
|
|
554
|
-
} else if (hDeath.mm
|
|
556
|
+
} else if (hDeath.mm === ADAR_I$1 && hDeath.dd === 30 && !isLeapYear(hyear)) {
|
|
555
557
|
// If it's the 30th in Adar I and year is not a leap year
|
|
556
558
|
// (so Adar has only 29 days), use the last day in Shevat.
|
|
557
559
|
hDeath.dd = 30;
|
|
@@ -559,10 +561,10 @@ function getYahrzeitHD(hyear, date) {
|
|
|
559
561
|
}
|
|
560
562
|
// In all other cases, use the normal anniversary of the date of death.
|
|
561
563
|
// advance day to rosh chodesh if needed
|
|
562
|
-
if (hDeath.mm
|
|
564
|
+
if (hDeath.mm === CHESHVAN && hDeath.dd === 30 && !longCheshvan(hyear)) {
|
|
563
565
|
hDeath.mm = KISLEV$1;
|
|
564
566
|
hDeath.dd = 1;
|
|
565
|
-
} else if (hDeath.mm
|
|
567
|
+
} else if (hDeath.mm === KISLEV$1 && hDeath.dd === 30 && shortKislev(hyear)) {
|
|
566
568
|
hDeath.mm = TEVET$1;
|
|
567
569
|
hDeath.dd = 1;
|
|
568
570
|
}
|
|
@@ -581,15 +583,15 @@ function getBirthdayHD(hyear, date) {
|
|
|
581
583
|
const isOrigLeap = isLeapYear(origYear);
|
|
582
584
|
let month = orig.mm;
|
|
583
585
|
let day = orig.dd;
|
|
584
|
-
if (month
|
|
586
|
+
if (month === ADAR_I$1 && !isOrigLeap || month === ADAR_II$1 && isOrigLeap) {
|
|
585
587
|
month = monthsInYear(hyear);
|
|
586
|
-
} else if (month
|
|
588
|
+
} else if (month === CHESHVAN && day === 30 && !longCheshvan(hyear)) {
|
|
587
589
|
month = KISLEV$1;
|
|
588
590
|
day = 1;
|
|
589
|
-
} else if (month
|
|
591
|
+
} else if (month === KISLEV$1 && day === 30 && shortKislev(hyear)) {
|
|
590
592
|
month = TEVET$1;
|
|
591
593
|
day = 1;
|
|
592
|
-
} else if (month
|
|
594
|
+
} else if (month === ADAR_I$1 && day === 30 && isOrigLeap && !isLeapYear(hyear)) {
|
|
593
595
|
month = NISAN$3;
|
|
594
596
|
day = 1;
|
|
595
597
|
}
|
|
@@ -603,28 +605,28 @@ function getBirthdayHD(hyear, date) {
|
|
|
603
605
|
const GERESH = '׳';
|
|
604
606
|
const GERSHAYIM = '״';
|
|
605
607
|
const alefbet = {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
608
|
+
א: 1,
|
|
609
|
+
ב: 2,
|
|
610
|
+
ג: 3,
|
|
611
|
+
ד: 4,
|
|
612
|
+
ה: 5,
|
|
613
|
+
ו: 6,
|
|
614
|
+
ז: 7,
|
|
615
|
+
ח: 8,
|
|
616
|
+
ט: 9,
|
|
617
|
+
י: 10,
|
|
618
|
+
כ: 20,
|
|
619
|
+
ל: 30,
|
|
620
|
+
מ: 40,
|
|
621
|
+
נ: 50,
|
|
622
|
+
ס: 60,
|
|
623
|
+
ע: 70,
|
|
624
|
+
פ: 80,
|
|
625
|
+
צ: 90,
|
|
626
|
+
ק: 100,
|
|
627
|
+
ר: 200,
|
|
628
|
+
ש: 300,
|
|
629
|
+
ת: 400
|
|
628
630
|
};
|
|
629
631
|
const heb2num = new Map();
|
|
630
632
|
const num2heb = new Map();
|
|
@@ -682,7 +684,7 @@ function gematriya(num) {
|
|
|
682
684
|
str += GERESH;
|
|
683
685
|
}
|
|
684
686
|
const digits = num2digits(num1 % 1000);
|
|
685
|
-
if (digits.length
|
|
687
|
+
if (digits.length === 1) {
|
|
686
688
|
return str + num2heb.get(digits[0]) + GERESH;
|
|
687
689
|
}
|
|
688
690
|
for (let i = 0; i < digits.length; i++) {
|
|
@@ -720,6 +722,175 @@ function gematriyaStrToNum(str) {
|
|
|
720
722
|
return num;
|
|
721
723
|
}
|
|
722
724
|
|
|
725
|
+
const sefirot = {
|
|
726
|
+
en: {
|
|
727
|
+
infix: 'within ',
|
|
728
|
+
infix26: 'within ',
|
|
729
|
+
words: ['', 'Lovingkindness', 'Might', 'Beauty', 'Eternity', 'Splendor', 'Foundation', 'Majesty']
|
|
730
|
+
},
|
|
731
|
+
he: {
|
|
732
|
+
infix: 'שֶׁבְּ',
|
|
733
|
+
infix26: 'שֶׁבִּ',
|
|
734
|
+
words: ['', 'חֶֽסֶד', 'גְבוּרָה', 'תִּפאֶרֶת', 'נֶּֽצַח', 'הוֹד', 'יְּסוֹד', 'מַּלְכוּת']
|
|
735
|
+
},
|
|
736
|
+
translit: {
|
|
737
|
+
infix: "sheb'",
|
|
738
|
+
infix26: 'shebi',
|
|
739
|
+
words: ['', 'Chesed', 'Gevurah', 'Tiferet', 'Netzach', 'Hod', 'Yesod', 'Malkhut']
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
function checkDay(omerDay) {
|
|
743
|
+
if (omerDay < 1 || omerDay > 49) {
|
|
744
|
+
throw new RangeError(`Invalid Omer day ${omerDay}`);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
function getWeeks(omerDay) {
|
|
748
|
+
const weekNum = Math.floor((omerDay - 1) / 7) + 1;
|
|
749
|
+
const daysWithinWeeks = omerDay % 7 || 7;
|
|
750
|
+
return [weekNum, daysWithinWeeks];
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Returns the sefira. For example, on day 8
|
|
754
|
+
* חֶֽסֶד שֶׁבִּגְבוּרָה
|
|
755
|
+
* Chesed shebiGevurah
|
|
756
|
+
* Lovingkindness within Might
|
|
757
|
+
* @param omerDay the day of the omer, 1-49 inclusive
|
|
758
|
+
* @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)
|
|
759
|
+
* @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
|
|
760
|
+
*/
|
|
761
|
+
function omerSefira(omerDay, lang) {
|
|
762
|
+
checkDay(omerDay);
|
|
763
|
+
const [weekNum, daysWithinWeeks] = getWeeks(omerDay);
|
|
764
|
+
const config = sefirot[lang];
|
|
765
|
+
const week = config.words[weekNum];
|
|
766
|
+
const dayWithinWeek = config.words[daysWithinWeeks];
|
|
767
|
+
const infix = weekNum === 2 || weekNum === 6 ? config.infix26 : config.infix;
|
|
768
|
+
return (dayWithinWeek + ' ' + infix + week).normalize();
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Returns a sentence with that evening's omer count
|
|
772
|
+
* @param omerDay the day of the omer, 1-49 inclusive
|
|
773
|
+
* @param lang `en` (English), `he` (Hebrew with nikud)
|
|
774
|
+
* @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
|
|
775
|
+
* or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
|
|
776
|
+
*/
|
|
777
|
+
function omerTodayIs(omerDay, lang) {
|
|
778
|
+
checkDay(omerDay);
|
|
779
|
+
if (lang === 'en') {
|
|
780
|
+
return omerTodayIsEn(omerDay);
|
|
781
|
+
} else if (lang === 'he') {
|
|
782
|
+
return omerTodayIsHe(omerDay);
|
|
783
|
+
} else {
|
|
784
|
+
return undefined;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
function omerTodayIsEn(omerDay) {
|
|
788
|
+
const [weekNumber, daysWithinWeeks] = getWeeks(omerDay);
|
|
789
|
+
const totalDaysStr = omerDay === 1 ? 'day' : 'days';
|
|
790
|
+
let str = `Today is ${omerDay} ${totalDaysStr}`;
|
|
791
|
+
if (weekNumber > 1 || omerDay === 7) {
|
|
792
|
+
const day7 = daysWithinWeeks === 7;
|
|
793
|
+
const numWeeks = day7 ? weekNumber : weekNumber - 1;
|
|
794
|
+
const weeksStr = numWeeks === 1 ? 'week' : 'weeks';
|
|
795
|
+
str += `, which is ${numWeeks} ${weeksStr}`;
|
|
796
|
+
if (!day7) {
|
|
797
|
+
const daysStr = daysWithinWeeks === 1 ? 'day' : 'days';
|
|
798
|
+
str += ` and ${daysWithinWeeks} ${daysStr}`;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return str + ' of the Omer';
|
|
802
|
+
}
|
|
803
|
+
// adapted from pip hdate package (GPL)
|
|
804
|
+
// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
|
|
805
|
+
const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
|
|
806
|
+
const ones = ['', 'אֶחָד', 'שְׁנַיִם', 'שְׁלוֹשָׁה', 'אַרְבָּעָה', 'חֲמִשָּׁה', 'שִׁשָּׁה', 'שִׁבְעָה', 'שְׁמוֹנָה', 'תִּשְׁעָה'];
|
|
807
|
+
const shnei = 'שְׁנֵי';
|
|
808
|
+
const yamim = 'יָמִים';
|
|
809
|
+
const shneiYamim = shnei + ' ' + yamim;
|
|
810
|
+
const shavuot = 'שָׁבוּעוֹת';
|
|
811
|
+
const yom = 'יוֹם';
|
|
812
|
+
const yomEchad = yom + ' ' + ones[1];
|
|
813
|
+
function omerTodayIsHe(omerDay) {
|
|
814
|
+
const ten = Math.floor(omerDay / 10);
|
|
815
|
+
const one = omerDay % 10;
|
|
816
|
+
let str = 'הַיּוֹם ';
|
|
817
|
+
if (10 < omerDay && omerDay < 20) {
|
|
818
|
+
str += ones[one] + ' עָשָׂר';
|
|
819
|
+
} else if (omerDay > 9) {
|
|
820
|
+
str += ones[one];
|
|
821
|
+
if (one) {
|
|
822
|
+
str += ' ';
|
|
823
|
+
str += ten === 3 ? 'וּ' : 'וְ';
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (omerDay > 2) {
|
|
827
|
+
if (omerDay > 20 || omerDay === 10 || omerDay === 20) {
|
|
828
|
+
str += tens[ten];
|
|
829
|
+
}
|
|
830
|
+
if (omerDay < 11) {
|
|
831
|
+
str += ones[one] + ' ' + yamim + ' ';
|
|
832
|
+
} else {
|
|
833
|
+
str += ' ' + yom + ' ';
|
|
834
|
+
}
|
|
835
|
+
} else if (omerDay === 1) {
|
|
836
|
+
str += yomEchad + ' ';
|
|
837
|
+
} else {
|
|
838
|
+
// omer == 2
|
|
839
|
+
str += shneiYamim + ' ';
|
|
840
|
+
}
|
|
841
|
+
if (omerDay > 6) {
|
|
842
|
+
str = str.trim(); // remove trailing space before comma
|
|
843
|
+
str += ', שְׁהֵם ';
|
|
844
|
+
const weeks = Math.floor(omerDay / 7);
|
|
845
|
+
const days = omerDay % 7;
|
|
846
|
+
if (weeks > 2) {
|
|
847
|
+
str += ones[weeks] + ' ' + shavuot + ' ';
|
|
848
|
+
} else if (weeks === 1) {
|
|
849
|
+
str += 'שָׁבֽוּעַ' + ' ' + ones[1] + ' ';
|
|
850
|
+
} else {
|
|
851
|
+
// weeks == 2
|
|
852
|
+
str += shnei + ' ' + shavuot + ' ';
|
|
853
|
+
}
|
|
854
|
+
if (days) {
|
|
855
|
+
if (days === 2 || days === 3) {
|
|
856
|
+
str += 'וּ';
|
|
857
|
+
} else if (days === 5) {
|
|
858
|
+
str += 'וַ';
|
|
859
|
+
} else {
|
|
860
|
+
str += 'וְ';
|
|
861
|
+
}
|
|
862
|
+
if (days > 2) {
|
|
863
|
+
str += ones[days] + ' ' + yamim + ' ';
|
|
864
|
+
} else if (days === 1) {
|
|
865
|
+
str += yomEchad + ' ';
|
|
866
|
+
} else {
|
|
867
|
+
// days == 2
|
|
868
|
+
str += shneiYamim + ' ';
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
str += 'לָעֽוֹמֶר';
|
|
873
|
+
return str.normalize();
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Returns an emoji number symbol with a circle, for example `㊲`
|
|
877
|
+
* from the “Enclosed CJK Letters and Months” block of the Unicode standard
|
|
878
|
+
* @param omerDay the day of the omer, 1-49 inclusive
|
|
879
|
+
* @returns a single Unicode character from `①` through `㊾`
|
|
880
|
+
*/
|
|
881
|
+
function omerEmoji(omerDay) {
|
|
882
|
+
checkDay(omerDay);
|
|
883
|
+
if (omerDay <= 20) {
|
|
884
|
+
return String.fromCodePoint(9312 + omerDay - 1);
|
|
885
|
+
} else if (omerDay <= 35) {
|
|
886
|
+
// between 21 and 35 inclusive
|
|
887
|
+
return String.fromCodePoint(12881 + omerDay - 21);
|
|
888
|
+
} else {
|
|
889
|
+
// between 36 and 49 inclusive
|
|
890
|
+
return String.fromCodePoint(12977 + omerDay - 36);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
|
|
723
894
|
const noopLocale = {
|
|
724
895
|
headers: {
|
|
725
896
|
'plural-forms': 'nplurals=2; plural=(n!=1);'
|
|
@@ -7585,32 +7756,16 @@ class GeoLocation {
|
|
|
7585
7756
|
* the <code>TimeZone</code> for the location.
|
|
7586
7757
|
*/
|
|
7587
7758
|
constructor(name, latitude, longitude, elevation, timeZoneId) {
|
|
7759
|
+
/**
|
|
7760
|
+
* @private
|
|
7761
|
+
*/
|
|
7762
|
+
this.locationName = null;
|
|
7588
7763
|
this.setLocationName(name);
|
|
7589
7764
|
this.setLatitude(latitude);
|
|
7590
7765
|
this.setLongitude(longitude);
|
|
7591
7766
|
this.setElevation(elevation);
|
|
7592
7767
|
this.setTimeZone(timeZoneId);
|
|
7593
7768
|
}
|
|
7594
|
-
/**
|
|
7595
|
-
* @private
|
|
7596
|
-
*/
|
|
7597
|
-
latitude;
|
|
7598
|
-
/**
|
|
7599
|
-
* @private
|
|
7600
|
-
*/
|
|
7601
|
-
longitude;
|
|
7602
|
-
/**
|
|
7603
|
-
* @private
|
|
7604
|
-
*/
|
|
7605
|
-
locationName = null;
|
|
7606
|
-
/**
|
|
7607
|
-
* @private
|
|
7608
|
-
*/
|
|
7609
|
-
timeZoneId;
|
|
7610
|
-
/**
|
|
7611
|
-
* @private
|
|
7612
|
-
*/
|
|
7613
|
-
elevation;
|
|
7614
7769
|
/**
|
|
7615
7770
|
* Method to get the elevation in Meters.
|
|
7616
7771
|
*
|
|
@@ -7730,39 +7885,6 @@ class NOAACalculator {
|
|
|
7730
7885
|
this.date = date;
|
|
7731
7886
|
this.geoLocation = geoLocation;
|
|
7732
7887
|
}
|
|
7733
|
-
/**
|
|
7734
|
-
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
7735
|
-
* @private
|
|
7736
|
-
*/
|
|
7737
|
-
static GEOMETRIC_ZENITH = 90;
|
|
7738
|
-
/**
|
|
7739
|
-
* Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the
|
|
7740
|
-
* center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth
|
|
7741
|
-
* were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun is not
|
|
7742
|
-
* a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to true
|
|
7743
|
-
* sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
|
|
7744
|
-
* obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16 minutes of
|
|
7745
|
-
* arc, and atmospheric refraction accounts for
|
|
7746
|
-
* 34 minutes or so, giving a total of 50
|
|
7747
|
-
* arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset.
|
|
7748
|
-
*/
|
|
7749
|
-
// const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;
|
|
7750
|
-
/** Sun's zenith at civil twilight (96°). */
|
|
7751
|
-
static CIVIL_ZENITH = 96;
|
|
7752
|
-
/** Sun's zenith at nautical twilight (102°). */
|
|
7753
|
-
static NAUTICAL_ZENITH = 102;
|
|
7754
|
-
/** Sun's zenith at astronomical twilight (108°). */
|
|
7755
|
-
static ASTRONOMICAL_ZENITH = 108;
|
|
7756
|
-
/**
|
|
7757
|
-
* The Java Calendar encapsulated by this class to track the current date used by the class
|
|
7758
|
-
* @private
|
|
7759
|
-
*/
|
|
7760
|
-
date;
|
|
7761
|
-
/**
|
|
7762
|
-
* the {@link GeoLocation} used for calculations.
|
|
7763
|
-
* @private
|
|
7764
|
-
*/
|
|
7765
|
-
geoLocation;
|
|
7766
7888
|
/**
|
|
7767
7889
|
* The getSunrise method Returns a `Date` representing the
|
|
7768
7890
|
* {@link getElevationAdjustment elevation adjusted} sunrise time. The zenith used
|
|
@@ -8106,16 +8228,6 @@ class NOAACalculator {
|
|
|
8106
8228
|
}
|
|
8107
8229
|
return adjustedZenith;
|
|
8108
8230
|
}
|
|
8109
|
-
/**
|
|
8110
|
-
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
8111
|
-
* @private
|
|
8112
|
-
*/
|
|
8113
|
-
static JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
8114
|
-
/**
|
|
8115
|
-
* Julian days per century
|
|
8116
|
-
* @private
|
|
8117
|
-
*/
|
|
8118
|
-
static JULIAN_DAYS_PER_CENTURY = 36525;
|
|
8119
8231
|
/**
|
|
8120
8232
|
* A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.
|
|
8121
8233
|
* @param date
|
|
@@ -8632,6 +8744,39 @@ class NOAACalculator {
|
|
|
8632
8744
|
return timeUTC;
|
|
8633
8745
|
}
|
|
8634
8746
|
}
|
|
8747
|
+
/**
|
|
8748
|
+
* The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
|
|
8749
|
+
* @private
|
|
8750
|
+
*/
|
|
8751
|
+
NOAACalculator.GEOMETRIC_ZENITH = 90;
|
|
8752
|
+
/**
|
|
8753
|
+
* Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the
|
|
8754
|
+
* center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth
|
|
8755
|
+
* were without an atmosphere, true sunset and sunrise would correspond to a 90° zenith. Because the Sun is not
|
|
8756
|
+
* a point, and because the atmosphere refracts light, this 90° zenith does not, in fact, correspond to true
|
|
8757
|
+
* sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be
|
|
8758
|
+
* obscured. This means that a zenith of just above 90° must be used. The Sun subtends an angle of 16 minutes of
|
|
8759
|
+
* arc, and atmospheric refraction accounts for
|
|
8760
|
+
* 34 minutes or so, giving a total of 50
|
|
8761
|
+
* arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333° for true sunrise/sunset.
|
|
8762
|
+
*/
|
|
8763
|
+
// const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;
|
|
8764
|
+
/** Sun's zenith at civil twilight (96°). */
|
|
8765
|
+
NOAACalculator.CIVIL_ZENITH = 96;
|
|
8766
|
+
/** Sun's zenith at nautical twilight (102°). */
|
|
8767
|
+
NOAACalculator.NAUTICAL_ZENITH = 102;
|
|
8768
|
+
/** Sun's zenith at astronomical twilight (108°). */
|
|
8769
|
+
NOAACalculator.ASTRONOMICAL_ZENITH = 108;
|
|
8770
|
+
/**
|
|
8771
|
+
* The <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> of January 1, 2000
|
|
8772
|
+
* @private
|
|
8773
|
+
*/
|
|
8774
|
+
NOAACalculator.JULIAN_DAY_JAN_1_2000 = 2451545;
|
|
8775
|
+
/**
|
|
8776
|
+
* Julian days per century
|
|
8777
|
+
* @private
|
|
8778
|
+
*/
|
|
8779
|
+
NOAACalculator.JULIAN_DAYS_PER_CENTURY = 36525;
|
|
8635
8780
|
|
|
8636
8781
|
/*
|
|
8637
8782
|
Hebcal - A Jewish Calendar Generator
|
|
@@ -9850,9 +9995,6 @@ class MoladEvent extends Event {
|
|
|
9850
9995
|
}
|
|
9851
9996
|
}
|
|
9852
9997
|
|
|
9853
|
-
const sefirot = [null, 'Lovingkindness', 'Might', 'Beauty', 'Eternity', 'Splendor', 'Foundation', 'Majesty'];
|
|
9854
|
-
const sefirotTranslit = [null, 'Chesed', 'Gevurah', 'Tiferet', 'Netzach', 'Hod', 'Yesod', 'Malkhut'];
|
|
9855
|
-
|
|
9856
9998
|
/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */
|
|
9857
9999
|
class OmerEvent extends Event {
|
|
9858
10000
|
/**
|
|
@@ -9874,39 +10016,10 @@ class OmerEvent extends Event {
|
|
|
9874
10016
|
*/
|
|
9875
10017
|
sefira() {
|
|
9876
10018
|
let lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
|
9877
|
-
if (lang
|
|
9878
|
-
|
|
9879
|
-
} else if (lang === 'translit') {
|
|
9880
|
-
return this.sefiraTranslit();
|
|
9881
|
-
} else {
|
|
9882
|
-
const week = sefirot[this.weekNumber];
|
|
9883
|
-
const dayWithinWeek = sefirot[this.daysWithinWeeks];
|
|
9884
|
-
return `${dayWithinWeek} within ${week}`;
|
|
10019
|
+
if (lang !== 'he' && lang !== 'translit') {
|
|
10020
|
+
lang = 'en';
|
|
9885
10021
|
}
|
|
9886
|
-
|
|
9887
|
-
/**
|
|
9888
|
-
* @private
|
|
9889
|
-
* @return {string}
|
|
9890
|
-
*/
|
|
9891
|
-
sefiraTranslit() {
|
|
9892
|
-
const weekNum = this.weekNumber;
|
|
9893
|
-
const translitWeek = sefirotTranslit[weekNum];
|
|
9894
|
-
const translitDayWithinWeek = sefirotTranslit[this.daysWithinWeeks];
|
|
9895
|
-
const translitPrefix = weekNum === 2 || weekNum === 6 ? 'shebi' : `sheb'`;
|
|
9896
|
-
return `${translitDayWithinWeek} ${translitPrefix}${translitWeek}`;
|
|
9897
|
-
}
|
|
9898
|
-
/**
|
|
9899
|
-
* @private
|
|
9900
|
-
* @return {string}
|
|
9901
|
-
*/
|
|
9902
|
-
sefiraHe() {
|
|
9903
|
-
const weekNum = this.weekNumber;
|
|
9904
|
-
const week = sefirot[weekNum];
|
|
9905
|
-
const dayWithinWeek = sefirot[this.daysWithinWeeks];
|
|
9906
|
-
const heWeek = Locale.gettext(week, 'he');
|
|
9907
|
-
const heDayWithinWeek = Locale.gettext(dayWithinWeek, 'he');
|
|
9908
|
-
const hePrefix = weekNum === 2 || weekNum === 6 ? 'שֶׁבִּ' : 'שֶׁבְּ';
|
|
9909
|
-
return `${heDayWithinWeek} ${hePrefix}${heWeek}`.normalize();
|
|
10022
|
+
return omerSefira(this.omer, lang);
|
|
9910
10023
|
}
|
|
9911
10024
|
/**
|
|
9912
10025
|
* @todo use gettext()
|
|
@@ -9930,16 +10043,7 @@ class OmerEvent extends Event {
|
|
|
9930
10043
|
/** @return {string} */
|
|
9931
10044
|
getEmoji() {
|
|
9932
10045
|
if (typeof this.emoji === 'string') return this.emoji;
|
|
9933
|
-
|
|
9934
|
-
if (number <= 20) {
|
|
9935
|
-
return String.fromCodePoint(9312 + number - 1);
|
|
9936
|
-
} else if (number <= 35) {
|
|
9937
|
-
// between 21 and 35 inclusive
|
|
9938
|
-
return String.fromCodePoint(12881 + number - 21);
|
|
9939
|
-
} else {
|
|
9940
|
-
// between 36 and 49 inclusive
|
|
9941
|
-
return String.fromCodePoint(12977 + number - 36);
|
|
9942
|
-
}
|
|
10046
|
+
return omerEmoji(this.omer);
|
|
9943
10047
|
}
|
|
9944
10048
|
/** @return {number} */
|
|
9945
10049
|
getWeeks() {
|
|
@@ -9960,23 +10064,12 @@ class OmerEvent extends Event {
|
|
|
9960
10064
|
locale = locale.toLowerCase();
|
|
9961
10065
|
}
|
|
9962
10066
|
if (locale === 'he') {
|
|
9963
|
-
return
|
|
10067
|
+
return omerTodayIs(this.omer, 'he');
|
|
9964
10068
|
} else if (locale === 'he-x-nonikud') {
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
const totalDaysStr = this.omer === 1 ? 'day' : 'days';
|
|
9968
|
-
let str = `Today is ${this.omer} ${totalDaysStr}`;
|
|
9969
|
-
if (this.weekNumber > 1 || this.omer === 7) {
|
|
9970
|
-
const day7 = this.daysWithinWeeks === 7;
|
|
9971
|
-
const numWeeks = day7 ? this.weekNumber : this.weekNumber - 1;
|
|
9972
|
-
const weeksStr = numWeeks === 1 ? 'week' : 'weeks';
|
|
9973
|
-
str += `, which is ${numWeeks} ${weeksStr}`;
|
|
9974
|
-
if (!day7) {
|
|
9975
|
-
const daysStr = this.daysWithinWeeks === 1 ? 'day' : 'days';
|
|
9976
|
-
str += ` and ${this.daysWithinWeeks} ${daysStr}`;
|
|
9977
|
-
}
|
|
10069
|
+
const str = omerTodayIs(this.omer, 'he');
|
|
10070
|
+
return Locale.hebrewStripNikkud(str);
|
|
9978
10071
|
}
|
|
9979
|
-
return
|
|
10072
|
+
return omerTodayIs(this.omer, 'en');
|
|
9980
10073
|
}
|
|
9981
10074
|
/** @return {string} */
|
|
9982
10075
|
url() {
|
|
@@ -9984,79 +10077,6 @@ class OmerEvent extends Event {
|
|
|
9984
10077
|
}
|
|
9985
10078
|
}
|
|
9986
10079
|
|
|
9987
|
-
// adapted from pip hdate package (GPL)
|
|
9988
|
-
// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
|
|
9989
|
-
|
|
9990
|
-
const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
|
|
9991
|
-
const ones = ['', 'אֶחָד', 'שְׁנַיִם', 'שְׁלוֹשָׁה', 'אַרְבָּעָה', 'חֲמִשָׁה', 'שִׁשָׁה', 'שִׁבְעָה', 'שְׁמוֹנָה', 'תִּשְׁעָה'];
|
|
9992
|
-
const shnei = 'שְׁנֵי';
|
|
9993
|
-
const yamim = 'יָמִים';
|
|
9994
|
-
const shneiYamim = shnei + ' ' + yamim;
|
|
9995
|
-
const shavuot = 'שָׁבוּעוֹת';
|
|
9996
|
-
const yom = 'יוֹם';
|
|
9997
|
-
const yomEchad = yom + ' ' + ones[1];
|
|
9998
|
-
|
|
9999
|
-
/**
|
|
10000
|
-
* @private
|
|
10001
|
-
* @param {number} omer
|
|
10002
|
-
* @return {string}
|
|
10003
|
-
*/
|
|
10004
|
-
function getTodayIsHe(omer) {
|
|
10005
|
-
const ten = Math.floor(omer / 10);
|
|
10006
|
-
const one = omer % 10;
|
|
10007
|
-
let str = 'הַיוֹם ';
|
|
10008
|
-
if (10 < omer && omer < 20) {
|
|
10009
|
-
str += ones[one] + ' עָשָׂר';
|
|
10010
|
-
} else if (omer > 9) {
|
|
10011
|
-
str += ones[one];
|
|
10012
|
-
if (one) {
|
|
10013
|
-
str += ' וְ';
|
|
10014
|
-
}
|
|
10015
|
-
}
|
|
10016
|
-
if (omer > 2) {
|
|
10017
|
-
if (omer > 20 || omer === 10 || omer === 20) {
|
|
10018
|
-
str += tens[ten];
|
|
10019
|
-
}
|
|
10020
|
-
if (omer < 11) {
|
|
10021
|
-
str += ones[one] + ' ' + yamim + ' ';
|
|
10022
|
-
} else {
|
|
10023
|
-
str += ' ' + yom + ' ';
|
|
10024
|
-
}
|
|
10025
|
-
} else if (omer === 1) {
|
|
10026
|
-
str += yomEchad + ' ';
|
|
10027
|
-
} else {
|
|
10028
|
-
// omer == 2
|
|
10029
|
-
str += shneiYamim + ' ';
|
|
10030
|
-
}
|
|
10031
|
-
if (omer > 6) {
|
|
10032
|
-
str = str.trim(); // remove trailing space before comma
|
|
10033
|
-
str += ', שְׁהֵם ';
|
|
10034
|
-
const weeks = Math.floor(omer / 7);
|
|
10035
|
-
const days = omer % 7;
|
|
10036
|
-
if (weeks > 2) {
|
|
10037
|
-
str += ones[weeks] + ' ' + shavuot + ' ';
|
|
10038
|
-
} else if (weeks == 1) {
|
|
10039
|
-
str += 'שָׁבוּעַ' + ' ' + ones[1] + ' ';
|
|
10040
|
-
} else {
|
|
10041
|
-
// weeks == 2
|
|
10042
|
-
str += shnei + ' ' + shavuot + ' ';
|
|
10043
|
-
}
|
|
10044
|
-
if (days) {
|
|
10045
|
-
str += 'וְ';
|
|
10046
|
-
if (days > 2) {
|
|
10047
|
-
str += ones[days] + ' ' + yamim + ' ';
|
|
10048
|
-
} else if (days == 1) {
|
|
10049
|
-
str += yomEchad + ' ';
|
|
10050
|
-
} else {
|
|
10051
|
-
// days == 2
|
|
10052
|
-
str += shneiYamim + ' ';
|
|
10053
|
-
}
|
|
10054
|
-
}
|
|
10055
|
-
}
|
|
10056
|
-
str += 'לָעוֹמֶר';
|
|
10057
|
-
return str.normalize();
|
|
10058
|
-
}
|
|
10059
|
-
|
|
10060
10080
|
class QuickLRU extends Map {
|
|
10061
10081
|
#size = 0;
|
|
10062
10082
|
#cache = new Map();
|
|
@@ -11853,7 +11873,7 @@ class DailyLearning {
|
|
|
11853
11873
|
}
|
|
11854
11874
|
|
|
11855
11875
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
11856
|
-
const version = '5.3.
|
|
11876
|
+
const version = '5.3.4';
|
|
11857
11877
|
|
|
11858
11878
|
const NONE$1 = 0;
|
|
11859
11879
|
const HALF = 1;
|