@hebcal/core 5.3.3 → 5.3.5
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 +233 -187
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +305 -209
- package/dist/index.mjs +305 -209
- package/package.json +5 -5
package/dist/bundle.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/*! @hebcal/core v5.3.
|
|
1
|
+
/*! @hebcal/core v5.3.5 */
|
|
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);'
|
|
@@ -9824,9 +9995,6 @@ class MoladEvent extends Event {
|
|
|
9824
9995
|
}
|
|
9825
9996
|
}
|
|
9826
9997
|
|
|
9827
|
-
const sefirot = [null, 'Lovingkindness', 'Might', 'Beauty', 'Eternity', 'Splendor', 'Foundation', 'Majesty'];
|
|
9828
|
-
const sefirotTranslit = [null, 'Chesed', 'Gevurah', 'Tiferet', 'Netzach', 'Hod', 'Yesod', 'Malkhut'];
|
|
9829
|
-
|
|
9830
9998
|
/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */
|
|
9831
9999
|
class OmerEvent extends Event {
|
|
9832
10000
|
/**
|
|
@@ -9848,39 +10016,10 @@ class OmerEvent extends Event {
|
|
|
9848
10016
|
*/
|
|
9849
10017
|
sefira() {
|
|
9850
10018
|
let lang = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
|
9851
|
-
if (lang
|
|
9852
|
-
|
|
9853
|
-
} else if (lang === 'translit') {
|
|
9854
|
-
return this.sefiraTranslit();
|
|
9855
|
-
} else {
|
|
9856
|
-
const week = sefirot[this.weekNumber];
|
|
9857
|
-
const dayWithinWeek = sefirot[this.daysWithinWeeks];
|
|
9858
|
-
return `${dayWithinWeek} within ${week}`;
|
|
10019
|
+
if (lang !== 'he' && lang !== 'translit') {
|
|
10020
|
+
lang = 'en';
|
|
9859
10021
|
}
|
|
9860
|
-
|
|
9861
|
-
/**
|
|
9862
|
-
* @private
|
|
9863
|
-
* @return {string}
|
|
9864
|
-
*/
|
|
9865
|
-
sefiraTranslit() {
|
|
9866
|
-
const weekNum = this.weekNumber;
|
|
9867
|
-
const translitWeek = sefirotTranslit[weekNum];
|
|
9868
|
-
const translitDayWithinWeek = sefirotTranslit[this.daysWithinWeeks];
|
|
9869
|
-
const translitPrefix = weekNum === 2 || weekNum === 6 ? 'shebi' : `sheb'`;
|
|
9870
|
-
return `${translitDayWithinWeek} ${translitPrefix}${translitWeek}`;
|
|
9871
|
-
}
|
|
9872
|
-
/**
|
|
9873
|
-
* @private
|
|
9874
|
-
* @return {string}
|
|
9875
|
-
*/
|
|
9876
|
-
sefiraHe() {
|
|
9877
|
-
const weekNum = this.weekNumber;
|
|
9878
|
-
const week = sefirot[weekNum];
|
|
9879
|
-
const dayWithinWeek = sefirot[this.daysWithinWeeks];
|
|
9880
|
-
const heWeek = Locale.gettext(week, 'he');
|
|
9881
|
-
const heDayWithinWeek = Locale.gettext(dayWithinWeek, 'he');
|
|
9882
|
-
const hePrefix = weekNum === 2 || weekNum === 6 ? 'שֶׁבִּ' : 'שֶׁבְּ';
|
|
9883
|
-
return `${heDayWithinWeek} ${hePrefix}${heWeek}`.normalize();
|
|
10022
|
+
return omerSefira(this.omer, lang);
|
|
9884
10023
|
}
|
|
9885
10024
|
/**
|
|
9886
10025
|
* @todo use gettext()
|
|
@@ -9904,16 +10043,7 @@ class OmerEvent extends Event {
|
|
|
9904
10043
|
/** @return {string} */
|
|
9905
10044
|
getEmoji() {
|
|
9906
10045
|
if (typeof this.emoji === 'string') return this.emoji;
|
|
9907
|
-
|
|
9908
|
-
if (number <= 20) {
|
|
9909
|
-
return String.fromCodePoint(9312 + number - 1);
|
|
9910
|
-
} else if (number <= 35) {
|
|
9911
|
-
// between 21 and 35 inclusive
|
|
9912
|
-
return String.fromCodePoint(12881 + number - 21);
|
|
9913
|
-
} else {
|
|
9914
|
-
// between 36 and 49 inclusive
|
|
9915
|
-
return String.fromCodePoint(12977 + number - 36);
|
|
9916
|
-
}
|
|
10046
|
+
return omerEmoji(this.omer);
|
|
9917
10047
|
}
|
|
9918
10048
|
/** @return {number} */
|
|
9919
10049
|
getWeeks() {
|
|
@@ -9934,23 +10064,12 @@ class OmerEvent extends Event {
|
|
|
9934
10064
|
locale = locale.toLowerCase();
|
|
9935
10065
|
}
|
|
9936
10066
|
if (locale === 'he') {
|
|
9937
|
-
return
|
|
10067
|
+
return omerTodayIs(this.omer, 'he');
|
|
9938
10068
|
} else if (locale === 'he-x-nonikud') {
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
const totalDaysStr = this.omer === 1 ? 'day' : 'days';
|
|
9942
|
-
let str = `Today is ${this.omer} ${totalDaysStr}`;
|
|
9943
|
-
if (this.weekNumber > 1 || this.omer === 7) {
|
|
9944
|
-
const day7 = this.daysWithinWeeks === 7;
|
|
9945
|
-
const numWeeks = day7 ? this.weekNumber : this.weekNumber - 1;
|
|
9946
|
-
const weeksStr = numWeeks === 1 ? 'week' : 'weeks';
|
|
9947
|
-
str += `, which is ${numWeeks} ${weeksStr}`;
|
|
9948
|
-
if (!day7) {
|
|
9949
|
-
const daysStr = this.daysWithinWeeks === 1 ? 'day' : 'days';
|
|
9950
|
-
str += ` and ${this.daysWithinWeeks} ${daysStr}`;
|
|
9951
|
-
}
|
|
10069
|
+
const str = omerTodayIs(this.omer, 'he');
|
|
10070
|
+
return Locale.hebrewStripNikkud(str);
|
|
9952
10071
|
}
|
|
9953
|
-
return
|
|
10072
|
+
return omerTodayIs(this.omer, 'en');
|
|
9954
10073
|
}
|
|
9955
10074
|
/** @return {string} */
|
|
9956
10075
|
url() {
|
|
@@ -9958,79 +10077,6 @@ class OmerEvent extends Event {
|
|
|
9958
10077
|
}
|
|
9959
10078
|
}
|
|
9960
10079
|
|
|
9961
|
-
// adapted from pip hdate package (GPL)
|
|
9962
|
-
// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
|
|
9963
|
-
|
|
9964
|
-
const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
|
|
9965
|
-
const ones = ['', 'אֶחָד', 'שְׁנַיִם', 'שְׁלוֹשָׁה', 'אַרְבָּעָה', 'חֲמִשָׁה', 'שִׁשָׁה', 'שִׁבְעָה', 'שְׁמוֹנָה', 'תִּשְׁעָה'];
|
|
9966
|
-
const shnei = 'שְׁנֵי';
|
|
9967
|
-
const yamim = 'יָמִים';
|
|
9968
|
-
const shneiYamim = shnei + ' ' + yamim;
|
|
9969
|
-
const shavuot = 'שָׁבוּעוֹת';
|
|
9970
|
-
const yom = 'יוֹם';
|
|
9971
|
-
const yomEchad = yom + ' ' + ones[1];
|
|
9972
|
-
|
|
9973
|
-
/**
|
|
9974
|
-
* @private
|
|
9975
|
-
* @param {number} omer
|
|
9976
|
-
* @return {string}
|
|
9977
|
-
*/
|
|
9978
|
-
function getTodayIsHe(omer) {
|
|
9979
|
-
const ten = Math.floor(omer / 10);
|
|
9980
|
-
const one = omer % 10;
|
|
9981
|
-
let str = 'הַיוֹם ';
|
|
9982
|
-
if (10 < omer && omer < 20) {
|
|
9983
|
-
str += ones[one] + ' עָשָׂר';
|
|
9984
|
-
} else if (omer > 9) {
|
|
9985
|
-
str += ones[one];
|
|
9986
|
-
if (one) {
|
|
9987
|
-
str += ' וְ';
|
|
9988
|
-
}
|
|
9989
|
-
}
|
|
9990
|
-
if (omer > 2) {
|
|
9991
|
-
if (omer > 20 || omer === 10 || omer === 20) {
|
|
9992
|
-
str += tens[ten];
|
|
9993
|
-
}
|
|
9994
|
-
if (omer < 11) {
|
|
9995
|
-
str += ones[one] + ' ' + yamim + ' ';
|
|
9996
|
-
} else {
|
|
9997
|
-
str += ' ' + yom + ' ';
|
|
9998
|
-
}
|
|
9999
|
-
} else if (omer === 1) {
|
|
10000
|
-
str += yomEchad + ' ';
|
|
10001
|
-
} else {
|
|
10002
|
-
// omer == 2
|
|
10003
|
-
str += shneiYamim + ' ';
|
|
10004
|
-
}
|
|
10005
|
-
if (omer > 6) {
|
|
10006
|
-
str = str.trim(); // remove trailing space before comma
|
|
10007
|
-
str += ', שְׁהֵם ';
|
|
10008
|
-
const weeks = Math.floor(omer / 7);
|
|
10009
|
-
const days = omer % 7;
|
|
10010
|
-
if (weeks > 2) {
|
|
10011
|
-
str += ones[weeks] + ' ' + shavuot + ' ';
|
|
10012
|
-
} else if (weeks == 1) {
|
|
10013
|
-
str += 'שָׁבוּעַ' + ' ' + ones[1] + ' ';
|
|
10014
|
-
} else {
|
|
10015
|
-
// weeks == 2
|
|
10016
|
-
str += shnei + ' ' + shavuot + ' ';
|
|
10017
|
-
}
|
|
10018
|
-
if (days) {
|
|
10019
|
-
str += 'וְ';
|
|
10020
|
-
if (days > 2) {
|
|
10021
|
-
str += ones[days] + ' ' + yamim + ' ';
|
|
10022
|
-
} else if (days == 1) {
|
|
10023
|
-
str += yomEchad + ' ';
|
|
10024
|
-
} else {
|
|
10025
|
-
// days == 2
|
|
10026
|
-
str += shneiYamim + ' ';
|
|
10027
|
-
}
|
|
10028
|
-
}
|
|
10029
|
-
}
|
|
10030
|
-
str += 'לָעוֹמֶר';
|
|
10031
|
-
return str.normalize();
|
|
10032
|
-
}
|
|
10033
|
-
|
|
10034
10080
|
class QuickLRU extends Map {
|
|
10035
10081
|
#size = 0;
|
|
10036
10082
|
#cache = new Map();
|
|
@@ -11827,7 +11873,7 @@ class DailyLearning {
|
|
|
11827
11873
|
}
|
|
11828
11874
|
|
|
11829
11875
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
11830
|
-
const version = '5.3.
|
|
11876
|
+
const version = '5.3.5';
|
|
11831
11877
|
|
|
11832
11878
|
const NONE$1 = 0;
|
|
11833
11879
|
const HALF = 1;
|