@hebcal/core 3.38.0 → 3.38.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/README.md +39 -37
- package/dist/bundle.js +229 -239
- package/dist/bundle.min.js +1 -1
- package/dist/hdate-bundle.js +50 -35
- package/dist/hdate-bundle.min.js +1 -1
- package/dist/hdate.js +49 -34
- package/dist/hdate.mjs +49 -34
- package/dist/hdate0-bundle.js +23 -26
- package/dist/hdate0-bundle.min.js +1 -1
- package/dist/index.js +85 -95
- package/dist/index.mjs +85 -95
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/*! @hebcal/core v3.38.0 */
|
|
2
|
-
|
|
2
|
+
/*
|
|
3
3
|
* More minimal greg routines
|
|
4
4
|
*/
|
|
5
|
+
|
|
6
|
+
/** @private */
|
|
5
7
|
const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
8
|
+
/** @private */
|
|
9
|
+
|
|
6
10
|
const monthLengths = [lengths, lengths.slice()];
|
|
7
11
|
monthLengths[1][2] = 29;
|
|
8
12
|
/**
|
|
@@ -67,7 +71,7 @@ function isDate(obj) {
|
|
|
67
71
|
|
|
68
72
|
function dayOfYear(date) {
|
|
69
73
|
if (!isDate(date)) {
|
|
70
|
-
throw new TypeError(
|
|
74
|
+
throw new TypeError(`Argument not a Date: ${date}`);
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
let doy = date.getDate() + 31 * date.getMonth();
|
|
@@ -92,7 +96,7 @@ function dayOfYear(date) {
|
|
|
92
96
|
|
|
93
97
|
function greg2abs(date) {
|
|
94
98
|
if (!isDate(date)) {
|
|
95
|
-
throw new TypeError(
|
|
99
|
+
throw new TypeError(`Argument not a Date: ${date}`);
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
const year = date.getFullYear() - 1;
|
|
@@ -147,7 +151,7 @@ function toFixed(year, month, day) {
|
|
|
147
151
|
|
|
148
152
|
function abs2greg(abs) {
|
|
149
153
|
if (typeof abs !== 'number') {
|
|
150
|
-
throw new TypeError(
|
|
154
|
+
throw new TypeError(`Argument not a Number: ${abs}`);
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
abs = Math.trunc(abs);
|
|
@@ -615,7 +619,7 @@ Locale.addLocale('s', noopLocale);
|
|
|
615
619
|
Locale.addLocale('', noopLocale);
|
|
616
620
|
Locale.useLocale('en');
|
|
617
621
|
|
|
618
|
-
|
|
622
|
+
/*
|
|
619
623
|
* More minimal HDate
|
|
620
624
|
*/
|
|
621
625
|
const NISAN$3 = 1;
|
|
@@ -693,6 +697,7 @@ const AVG_HEBYEAR_DAYS = 365.24682220597794;
|
|
|
693
697
|
* Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
694
698
|
* R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
695
699
|
* Calendar.
|
|
700
|
+
* @private
|
|
696
701
|
* @param {number} year Hebrew year
|
|
697
702
|
* @param {number} month Hebrew month
|
|
698
703
|
* @param {number} day Hebrew date (1-30)
|
|
@@ -725,25 +730,7 @@ function hebrew2abs(year, month, day) {
|
|
|
725
730
|
*/
|
|
726
731
|
|
|
727
732
|
function newYear(year) {
|
|
728
|
-
return EPOCH + elapsedDays(year)
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* @private
|
|
732
|
-
* @param {number} year
|
|
733
|
-
* @return {number}
|
|
734
|
-
*/
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
function newYearDelay(year) {
|
|
738
|
-
const ny1 = elapsedDays(year);
|
|
739
|
-
const ny2 = elapsedDays(year + 1);
|
|
740
|
-
|
|
741
|
-
if (ny2 - ny1 === 356) {
|
|
742
|
-
return 2;
|
|
743
|
-
} else {
|
|
744
|
-
const ny0 = elapsedDays(year - 1);
|
|
745
|
-
return ny1 - ny0 === 382 ? 1 : 0;
|
|
746
|
-
}
|
|
733
|
+
return EPOCH + elapsedDays(year);
|
|
747
734
|
}
|
|
748
735
|
/**
|
|
749
736
|
* Converts absolute R.D. days to Hebrew date
|
|
@@ -782,6 +769,7 @@ function abs2hebrew(abs) {
|
|
|
782
769
|
}
|
|
783
770
|
/**
|
|
784
771
|
* Returns true if Hebrew year is a leap year
|
|
772
|
+
* @private
|
|
785
773
|
* @param {number} year Hebrew year
|
|
786
774
|
* @return {boolean}
|
|
787
775
|
*/
|
|
@@ -791,6 +779,7 @@ function isLeapYear(year) {
|
|
|
791
779
|
}
|
|
792
780
|
/**
|
|
793
781
|
* Number of months in this Hebrew year (either 12 or 13 depending on leap year)
|
|
782
|
+
* @private
|
|
794
783
|
* @param {number} year Hebrew year
|
|
795
784
|
* @return {number}
|
|
796
785
|
*/
|
|
@@ -800,6 +789,7 @@ function monthsInYear(year) {
|
|
|
800
789
|
}
|
|
801
790
|
/**
|
|
802
791
|
* Number of days in Hebrew month in a given year (29 or 30)
|
|
792
|
+
* @private
|
|
803
793
|
* @param {number} month Hebrew month (e.g. months.TISHREI)
|
|
804
794
|
* @param {number} year Hebrew year
|
|
805
795
|
* @return {number}
|
|
@@ -824,13 +814,14 @@ function daysInMonth(month, year) {
|
|
|
824
814
|
/**
|
|
825
815
|
* Returns a transliterated string name of Hebrew month in year,
|
|
826
816
|
* for example 'Elul' or 'Cheshvan'.
|
|
817
|
+
* @private
|
|
827
818
|
* @param {number} month Hebrew month (e.g. months.TISHREI)
|
|
828
819
|
* @param {number} year Hebrew year
|
|
829
820
|
* @return {string}
|
|
830
821
|
*/
|
|
831
822
|
|
|
832
823
|
function getMonthName(month, year) {
|
|
833
|
-
if (typeof month !== 'number' || month < 1 || month > 14) {
|
|
824
|
+
if (typeof month !== 'number' || isNaN(month) || month < 1 || month > 14) {
|
|
834
825
|
throw new TypeError(`bad month argument ${month}`);
|
|
835
826
|
}
|
|
836
827
|
|
|
@@ -839,6 +830,7 @@ function getMonthName(month, year) {
|
|
|
839
830
|
/**
|
|
840
831
|
* Days from sunday prior to start of Hebrew calendar to mean
|
|
841
832
|
* conjunction of Tishrei in Hebrew YEAR
|
|
833
|
+
* @private
|
|
842
834
|
* @param {number} year Hebrew year
|
|
843
835
|
* @return {number}
|
|
844
836
|
*/
|
|
@@ -869,7 +861,10 @@ function elapsedDays0(year) {
|
|
|
869
861
|
return altDay + (altDay % 7 === 0 || altDay % 7 === 3 || altDay % 7 === 5);
|
|
870
862
|
}
|
|
871
863
|
/**
|
|
872
|
-
* Number of days in the hebrew YEAR
|
|
864
|
+
* Number of days in the hebrew YEAR.
|
|
865
|
+
* A common Hebrew calendar year can have a length of 353, 354 or 355 days
|
|
866
|
+
* A leap Hebrew calendar year can have a length of 383, 384 or 385 days
|
|
867
|
+
* @private
|
|
873
868
|
* @param {number} year Hebrew year
|
|
874
869
|
* @return {number}
|
|
875
870
|
*/
|
|
@@ -880,6 +875,7 @@ function daysInYear(year) {
|
|
|
880
875
|
}
|
|
881
876
|
/**
|
|
882
877
|
* true if Cheshvan is long in Hebrew year
|
|
878
|
+
* @private
|
|
883
879
|
* @param {number} year Hebrew year
|
|
884
880
|
* @return {boolean}
|
|
885
881
|
*/
|
|
@@ -889,6 +885,7 @@ function longCheshvan(year) {
|
|
|
889
885
|
}
|
|
890
886
|
/**
|
|
891
887
|
* true if Kislev is short in Hebrew year
|
|
888
|
+
* @private
|
|
892
889
|
* @param {number} year Hebrew year
|
|
893
890
|
* @return {boolean}
|
|
894
891
|
*/
|
|
@@ -998,19 +995,22 @@ class HDate {
|
|
|
998
995
|
* @type {number}
|
|
999
996
|
*/
|
|
1000
997
|
|
|
1001
|
-
|
|
998
|
+
year = parseInt(year, 10);
|
|
1002
999
|
|
|
1003
|
-
if (isNaN(
|
|
1000
|
+
if (isNaN(year)) {
|
|
1004
1001
|
throw new TypeError(`HDate called with bad year argument: ${year}`);
|
|
1005
1002
|
}
|
|
1006
1003
|
|
|
1004
|
+
this.year = year;
|
|
1007
1005
|
this.setMonth(month); // will throw if we can't parse
|
|
1008
1006
|
|
|
1009
|
-
|
|
1007
|
+
day = parseInt(day, 10);
|
|
1010
1008
|
|
|
1011
|
-
if (isNaN(
|
|
1009
|
+
if (isNaN(day)) {
|
|
1012
1010
|
throw new TypeError(`HDate called with bad day argument: ${day}`);
|
|
1013
1011
|
}
|
|
1012
|
+
|
|
1013
|
+
this.setDate(day);
|
|
1014
1014
|
} else {
|
|
1015
1015
|
// 0 arguments
|
|
1016
1016
|
if (typeof day === 'undefined') {
|
|
@@ -1018,7 +1018,7 @@ class HDate {
|
|
|
1018
1018
|
} // 1 argument
|
|
1019
1019
|
|
|
1020
1020
|
|
|
1021
|
-
const abs0 = typeof day === 'number' && !isNaN(day) ? day :
|
|
1021
|
+
const abs0 = typeof day === 'number' && !isNaN(day) ? day : isDate(day) ? greg2abs(day) : HDate.isHDate(day) ? {
|
|
1022
1022
|
dd: day.day,
|
|
1023
1023
|
mm: day.month,
|
|
1024
1024
|
yy: day.year
|
|
@@ -1163,7 +1163,7 @@ class HDate {
|
|
|
1163
1163
|
|
|
1164
1164
|
|
|
1165
1165
|
greg() {
|
|
1166
|
-
return
|
|
1166
|
+
return abs2greg(this.abs());
|
|
1167
1167
|
}
|
|
1168
1168
|
/**
|
|
1169
1169
|
* Returns R.D. (Rata Die) fixed days.
|
|
@@ -1562,7 +1562,15 @@ class HDate {
|
|
|
1562
1562
|
|
|
1563
1563
|
|
|
1564
1564
|
static monthNum(month) {
|
|
1565
|
-
|
|
1565
|
+
if (typeof month === 'number') {
|
|
1566
|
+
if (isNaN(month) || month > 14) {
|
|
1567
|
+
throw new RangeError(`Invalid month number: ${month}`);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
return month;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 ?
|
|
1566
1574
|
/* number */
|
|
1567
1575
|
parseInt(month, 10) : HDate.monthFromName(month);
|
|
1568
1576
|
}
|
|
@@ -1604,7 +1612,14 @@ class HDate {
|
|
|
1604
1612
|
|
|
1605
1613
|
|
|
1606
1614
|
static monthFromName(monthName) {
|
|
1607
|
-
if (typeof monthName === 'number')
|
|
1615
|
+
if (typeof monthName === 'number') {
|
|
1616
|
+
if (isNaN(monthName) || monthName < 1 || monthName > 14) {
|
|
1617
|
+
throw new RangeError(`Invalid month name: ${monthName}`);
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
return monthName;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1608
1623
|
const c = monthName.toLowerCase();
|
|
1609
1624
|
/*
|
|
1610
1625
|
the Hebrew months are unique to their second letter
|
|
@@ -1836,31 +1851,6 @@ function onOrBefore(day, t, offset) {
|
|
|
1836
1851
|
return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
|
|
1837
1852
|
}
|
|
1838
1853
|
|
|
1839
|
-
const CHAG$1 = 0x000001;
|
|
1840
|
-
const LIGHT_CANDLES$2 = 0x000002;
|
|
1841
|
-
const YOM_TOV_ENDS$2 = 0x000004;
|
|
1842
|
-
const CHUL_ONLY$2 = 0x000008; // chutz l'aretz (Diaspora)
|
|
1843
|
-
|
|
1844
|
-
const IL_ONLY$2 = 0x000010; // b'aretz (Israel)
|
|
1845
|
-
|
|
1846
|
-
const LIGHT_CANDLES_TZEIS$2 = 0x000020;
|
|
1847
|
-
const CHANUKAH_CANDLES$2 = 0x000040;
|
|
1848
|
-
const ROSH_CHODESH$1 = 0x000080;
|
|
1849
|
-
const MINOR_FAST$2 = 0x000100;
|
|
1850
|
-
const SPECIAL_SHABBAT$2 = 0x000200;
|
|
1851
|
-
const PARSHA_HASHAVUA$1 = 0x000400;
|
|
1852
|
-
const DAF_YOMI$1 = 0x000800;
|
|
1853
|
-
const OMER_COUNT$1 = 0x001000;
|
|
1854
|
-
const MODERN_HOLIDAY$2 = 0x002000;
|
|
1855
|
-
const MAJOR_FAST$2 = 0x004000;
|
|
1856
|
-
const SHABBAT_MEVARCHIM$1 = 0x008000;
|
|
1857
|
-
const MOLAD = 0x010000;
|
|
1858
|
-
const USER_EVENT = 0x020000;
|
|
1859
|
-
const HEBREW_DATE = 0x040000;
|
|
1860
|
-
const MINOR_HOLIDAY$2 = 0x080000;
|
|
1861
|
-
const EREV$2 = 0x100000;
|
|
1862
|
-
const CHOL_HAMOED$2 = 0x200000;
|
|
1863
|
-
const MISHNA_YOMI = 0x400000;
|
|
1864
1854
|
/**
|
|
1865
1855
|
* Holiday flags for Event
|
|
1866
1856
|
* @readonly
|
|
@@ -1869,73 +1859,73 @@ const MISHNA_YOMI = 0x400000;
|
|
|
1869
1859
|
|
|
1870
1860
|
const flags = {
|
|
1871
1861
|
/** Chag, yontiff, yom tov */
|
|
1872
|
-
CHAG:
|
|
1862
|
+
CHAG: 0x000001,
|
|
1873
1863
|
|
|
1874
1864
|
/** Light candles 18 minutes before sundown */
|
|
1875
|
-
LIGHT_CANDLES:
|
|
1865
|
+
LIGHT_CANDLES: 0x000002,
|
|
1876
1866
|
|
|
1877
1867
|
/** End of holiday (end of Yom Tov) */
|
|
1878
|
-
YOM_TOV_ENDS:
|
|
1868
|
+
YOM_TOV_ENDS: 0x000004,
|
|
1879
1869
|
|
|
1880
1870
|
/** Observed only in the Diaspora (chutz l'aretz) */
|
|
1881
|
-
CHUL_ONLY:
|
|
1871
|
+
CHUL_ONLY: 0x000008,
|
|
1882
1872
|
|
|
1883
1873
|
/** Observed only in Israel */
|
|
1884
|
-
IL_ONLY:
|
|
1874
|
+
IL_ONLY: 0x000010,
|
|
1885
1875
|
|
|
1886
1876
|
/** Light candles in the evening at Tzeit time (3 small stars) */
|
|
1887
|
-
LIGHT_CANDLES_TZEIS:
|
|
1877
|
+
LIGHT_CANDLES_TZEIS: 0x000020,
|
|
1888
1878
|
|
|
1889
1879
|
/** Candle-lighting for Chanukah */
|
|
1890
|
-
CHANUKAH_CANDLES:
|
|
1880
|
+
CHANUKAH_CANDLES: 0x000040,
|
|
1891
1881
|
|
|
1892
1882
|
/** Rosh Chodesh, beginning of a new Hebrew month */
|
|
1893
|
-
ROSH_CHODESH:
|
|
1883
|
+
ROSH_CHODESH: 0x000080,
|
|
1894
1884
|
|
|
1895
1885
|
/** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */
|
|
1896
|
-
MINOR_FAST:
|
|
1886
|
+
MINOR_FAST: 0x000100,
|
|
1897
1887
|
|
|
1898
1888
|
/** Shabbat Shekalim, Zachor, ... */
|
|
1899
|
-
SPECIAL_SHABBAT:
|
|
1889
|
+
SPECIAL_SHABBAT: 0x000200,
|
|
1900
1890
|
|
|
1901
1891
|
/** Weekly sedrot on Saturdays */
|
|
1902
|
-
PARSHA_HASHAVUA:
|
|
1892
|
+
PARSHA_HASHAVUA: 0x000400,
|
|
1903
1893
|
|
|
1904
1894
|
/** Daily page of Talmud */
|
|
1905
|
-
DAF_YOMI:
|
|
1895
|
+
DAF_YOMI: 0x000800,
|
|
1906
1896
|
|
|
1907
1897
|
/** Days of the Omer */
|
|
1908
|
-
OMER_COUNT:
|
|
1898
|
+
OMER_COUNT: 0x000800,
|
|
1909
1899
|
|
|
1910
1900
|
/** Yom HaShoah, Yom HaAtzma'ut, ... */
|
|
1911
|
-
MODERN_HOLIDAY:
|
|
1901
|
+
MODERN_HOLIDAY: 0x002000,
|
|
1912
1902
|
|
|
1913
1903
|
/** Yom Kippur and Tish'a B'Av */
|
|
1914
|
-
MAJOR_FAST:
|
|
1904
|
+
MAJOR_FAST: 0x004000,
|
|
1915
1905
|
|
|
1916
1906
|
/** On the Saturday before Rosh Chodesh */
|
|
1917
|
-
SHABBAT_MEVARCHIM:
|
|
1907
|
+
SHABBAT_MEVARCHIM: 0x008000,
|
|
1918
1908
|
|
|
1919
1909
|
/** Molad */
|
|
1920
|
-
MOLAD,
|
|
1910
|
+
MOLAD: 0x010000,
|
|
1921
1911
|
|
|
1922
1912
|
/** Yahrzeit or Hebrew Anniversary */
|
|
1923
|
-
USER_EVENT,
|
|
1913
|
+
USER_EVENT: 0x020000,
|
|
1924
1914
|
|
|
1925
1915
|
/** Daily Hebrew date ("11th of Sivan, 5780") */
|
|
1926
|
-
HEBREW_DATE,
|
|
1916
|
+
HEBREW_DATE: 0x040000,
|
|
1927
1917
|
|
|
1928
1918
|
/** A holiday that's not major, modern, rosh chodesh, or a fast day */
|
|
1929
|
-
MINOR_HOLIDAY:
|
|
1919
|
+
MINOR_HOLIDAY: 0x080000,
|
|
1930
1920
|
|
|
1931
1921
|
/** Evening before a major or minor holiday */
|
|
1932
|
-
EREV:
|
|
1922
|
+
EREV: 0x080000,
|
|
1933
1923
|
|
|
1934
1924
|
/** Chol haMoed, intermediate days of Pesach or Sukkot */
|
|
1935
|
-
CHOL_HAMOED:
|
|
1925
|
+
CHOL_HAMOED: 0x200000,
|
|
1936
1926
|
|
|
1937
1927
|
/** Mishna Yomi */
|
|
1938
|
-
MISHNA_YOMI
|
|
1928
|
+
MISHNA_YOMI: 0x400000
|
|
1939
1929
|
};
|
|
1940
1930
|
/** Represents an Event with a title, date, and flags */
|
|
1941
1931
|
|
|
@@ -2053,7 +2043,7 @@ class Event {
|
|
|
2053
2043
|
|
|
2054
2044
|
|
|
2055
2045
|
observedInIsrael() {
|
|
2056
|
-
return !(this.mask & CHUL_ONLY
|
|
2046
|
+
return !(this.mask & flags.CHUL_ONLY);
|
|
2057
2047
|
}
|
|
2058
2048
|
/**
|
|
2059
2049
|
* Is this event observed in the Diaspora?
|
|
@@ -2067,7 +2057,7 @@ class Event {
|
|
|
2067
2057
|
|
|
2068
2058
|
|
|
2069
2059
|
observedInDiaspora() {
|
|
2070
|
-
return !(this.mask & IL_ONLY
|
|
2060
|
+
return !(this.mask & flags.IL_ONLY);
|
|
2071
2061
|
}
|
|
2072
2062
|
/**
|
|
2073
2063
|
* @deprecated
|
|
@@ -2618,7 +2608,7 @@ class Zmanim {
|
|
|
2618
2608
|
throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);
|
|
2619
2609
|
}
|
|
2620
2610
|
|
|
2621
|
-
const dt =
|
|
2611
|
+
const dt = isDate(date) ? date : HDate.isHDate(date) ? date.greg() : throwTypeError$2(`invalid date: ${date}`);
|
|
2622
2612
|
this.date = dt;
|
|
2623
2613
|
this.solarCalc = new SolarCalc(this.date, latitude, longitude);
|
|
2624
2614
|
this.sun = this.solarCalc.sun;
|
|
@@ -3983,8 +3973,8 @@ function getTodayIsHe(omer) {
|
|
|
3983
3973
|
|
|
3984
3974
|
/* eslint-disable no-multi-spaces */
|
|
3985
3975
|
const osdate = new Date(1923, 8, 11);
|
|
3986
|
-
const osday =
|
|
3987
|
-
const nsday =
|
|
3976
|
+
const osday = greg2abs(osdate);
|
|
3977
|
+
const nsday = greg2abs(new Date(1975, 5, 24));
|
|
3988
3978
|
const shas = [['Berachot', 64], ['Shabbat', 157], ['Eruvin', 105], ['Pesachim', 121], ['Shekalim', 22], ['Yoma', 88], ['Sukkah', 56], ['Beitzah', 40], ['Rosh Hashana', 35], ['Taanit', 31], ['Megillah', 32], ['Moed Katan', 29], ['Chagigah', 27], ['Yevamot', 122], ['Ketubot', 112], ['Nedarim', 91], ['Nazir', 66], ['Sotah', 49], ['Gitin', 90], ['Kiddushin', 82], ['Baba Kamma', 119], ['Baba Metzia', 119], ['Baba Batra', 176], ['Sanhedrin', 113], ['Makkot', 24], ['Shevuot', 49], ['Avodah Zarah', 76], ['Horayot', 14], ['Zevachim', 120], ['Menachot', 110], ['Chullin', 142], ['Bechorot', 61], ['Arachin', 34], ['Temurah', 34], ['Keritot', 28], ['Meilah', 22], ['Kinnim', 4], ['Tamid', 9], ['Midot', 5], ['Niddah', 73]].map(m => {
|
|
3989
3979
|
return {
|
|
3990
3980
|
name: m[0],
|
|
@@ -4006,7 +3996,7 @@ class DafYomi {
|
|
|
4006
3996
|
* @param {Date|HDate|number} gregdate Gregorian date
|
|
4007
3997
|
*/
|
|
4008
3998
|
constructor(gregdate) {
|
|
4009
|
-
const cday = typeof gregdate === 'number' && !isNaN(gregdate) ? gregdate :
|
|
3999
|
+
const cday = typeof gregdate === 'number' && !isNaN(gregdate) ? gregdate : isDate(gregdate) ? greg2abs(gregdate) : HDate.isHDate(gregdate) ? gregdate.abs() : throwTypeError$1(`non-date given to dafyomi: ${gregdate}`);
|
|
4010
4000
|
|
|
4011
4001
|
if (cday < osday) {
|
|
4012
4002
|
throw new RangeError(`Date ${gregdate} too early; Daf Yomi cycle began on ${osdate}`);
|
|
@@ -5261,7 +5251,7 @@ function getHolidaysForYear_(year) {
|
|
|
5261
5251
|
var mishnayot = [{k:"Berakhot",v:[5,8,6,7,5,8,5,8,5]},{k:"Peah",v:[6,8,8,11,8,11,8,9]},{k:"Demai",v:[4,5,6,7,11,12,8]},{k:"Kilayim",v:[9,11,7,9,8,9,8,6,10]},{k:"Sheviit",v:[8,10,10,10,9,6,7,11,9,9]},{k:"Terumot",v:[10,6,9,13,9,6,7,12,7,12,10]},{k:"Maasrot",v:[8,8,10,6,8]},{k:"Maaser Sheni",v:[7,10,13,12,15]},{k:"Challah",v:[9,8,10,11]},{k:"Orlah",v:[9,17,9]},{k:"Bikkurim",v:[11,11,12,5]},{k:"Shabbat",v:[11,7,6,2,4,10,4,7,7,6,6,6,7,4,3,8,8,3,6,5,3,6,5,5]},{k:"Eruvin",v:[10,6,9,11,9,10,11,11,4,15]},{k:"Pesachim",v:[7,8,8,9,10,6,13,8,11,9]},{k:"Shekalim",v:[7,5,4,9,6,6,7,8]},{k:"Yoma",v:[8,7,11,6,7,8,5,9]},{k:"Sukkah",v:[11,9,15,10,8]},{k:"Beitzah",v:[10,10,8,7,7]},{k:"Rosh Hashanah",v:[9,9,8,9]},{k:"Taanit",v:[7,10,9,8]},{k:"Megillah",v:[11,6,6,10]},{k:"Moed Katan",v:[10,5,9]},{k:"Chagigah",v:[8,7,8]},{k:"Yevamot",v:[4,10,10,13,6,6,6,6,6,9,7,6,13,9,10,7]},{k:"Ketubot",v:[10,10,9,12,9,7,10,8,9,6,6,4,11]},{k:"Nedarim",v:[4,5,11,8,6,10,9,7,10,8,12]},{k:"Nazir",v:[7,10,7,7,7,11,4,2,5]},{k:"Sotah",v:[9,6,8,5,5,4,8,7,15]},{k:"Gittin",v:[6,7,8,9,9,7,9,10,10]},{k:"Kiddushin",v:[10,10,13,14]},{k:"Bava Kamma",v:[4,6,11,9,7,6,7,7,12,10]},{k:"Bava Metzia",v:[8,11,12,12,11,8,11,9,13,6]},{k:"Bava Batra",v:[6,14,8,9,11,8,4,8,10,8]},{k:"Sanhedrin",v:[6,5,8,5,5,6,11,7,6,6,6]},{k:"Makkot",v:[10,8,16]},{k:"Shevuot",v:[7,5,11,13,5,7,8,6]},{k:"Eduyot",v:[14,10,12,12,7,3,9,7]},{k:"Avodah Zarah",v:[9,7,10,12,12]},{k:"Avot",v:[18,16,18,22,23,11]},{k:"Horayot",v:[5,7,8]},{k:"Zevachim",v:[4,5,6,6,8,7,6,12,7,8,8,6,8,10]},{k:"Menachot",v:[4,5,7,5,9,7,6,7,9,9,9,5,11]},{k:"Chullin",v:[7,10,7,7,5,7,6,6,8,4,2,5]},{k:"Bekhorot",v:[7,9,4,10,6,12,7,10,8]},{k:"Arakhin",v:[4,6,5,4,6,5,5,7,8]},{k:"Temurah",v:[6,3,5,4,6,5,6]},{k:"Keritot",v:[7,6,10,3,8,9]},{k:"Meilah",v:[4,9,8,6,5,6]},{k:"Tamid",v:[4,5,9,3,6,3,4]},{k:"Middot",v:[9,6,8,7,4]},{k:"Kinnim",v:[4,5,6]},{k:"Kelim",v:[9,8,8,4,11,4,6,11,8,8,9,8,8,8,6,8,17,9,10,7,3,10,5,17,9,9,12,10,8,4]},{k:"Oholot",v:[8,7,7,3,7,7,6,6,16,7,9,8,6,7,10,5,5,10]},{k:"Negaim",v:[6,5,8,11,5,8,5,10,3,10,12,7,12,13]},{k:"Parah",v:[4,5,11,4,9,5,12,11,9,6,9,11]},{k:"Tahorot",v:[9,8,8,13,9,10,9,9,9,8]},{k:"Mikvaot",v:[8,10,4,5,6,11,7,5,7,8]},{k:"Niddah",v:[7,7,7,7,9,14,5,4,11,8]},{k:"Makhshirin",v:[6,11,8,10,11,8]},{k:"Zavim",v:[6,4,3,7,12]},{k:"Tevul Yom",v:[5,8,6,7]},{k:"Yadayim",v:[5,4,5,8]},{k:"Oktzin",v:[6,10,12]}];
|
|
5262
5252
|
|
|
5263
5253
|
const cycleStartDate = new Date(1947, 4, 20);
|
|
5264
|
-
const mishnaYomiStart =
|
|
5254
|
+
const mishnaYomiStart = greg2abs(cycleStartDate);
|
|
5265
5255
|
const numMishnayot = 4192;
|
|
5266
5256
|
const numDays = numMishnayot / 2;
|
|
5267
5257
|
/**
|
|
@@ -5323,7 +5313,7 @@ class MishnaYomiIndex {
|
|
|
5323
5313
|
|
|
5324
5314
|
|
|
5325
5315
|
lookup(date) {
|
|
5326
|
-
const abs = typeof date === 'number' && !isNaN(date) ? date :
|
|
5316
|
+
const abs = typeof date === 'number' && !isNaN(date) ? date : isDate(date) ? greg2abs(date) : HDate.isHDate(date) ? date.abs() : throwTypeError(`Invalid date: ${date}`);
|
|
5327
5317
|
|
|
5328
5318
|
if (abs < mishnaYomiStart) {
|
|
5329
5319
|
const s = date.toISOString().substring(0, 10);
|
|
@@ -5731,7 +5721,7 @@ function checkCandleOptions(options) {
|
|
|
5731
5721
|
|
|
5732
5722
|
function getAbs(d) {
|
|
5733
5723
|
if (typeof d == 'number') return d;
|
|
5734
|
-
if (
|
|
5724
|
+
if (isDate(d)) return greg2abs(d);
|
|
5735
5725
|
if (HDate.isHDate(d)) return d.abs();
|
|
5736
5726
|
throw new TypeError(`Invalid date type: ${d}`);
|
|
5737
5727
|
}
|
|
@@ -5793,11 +5783,11 @@ function getStartAndEnd(options) {
|
|
|
5793
5783
|
startGreg.setFullYear(theYear);
|
|
5794
5784
|
}
|
|
5795
5785
|
|
|
5796
|
-
const startAbs =
|
|
5786
|
+
const startAbs = greg2abs(startGreg);
|
|
5797
5787
|
let endAbs;
|
|
5798
5788
|
|
|
5799
5789
|
if (options.month) {
|
|
5800
|
-
endAbs = startAbs +
|
|
5790
|
+
endAbs = startAbs + daysInMonth$1(theMonth, theYear) - 1;
|
|
5801
5791
|
} else {
|
|
5802
5792
|
const endYear = theYear + numYears;
|
|
5803
5793
|
const endGreg = new Date(endYear, 0, 1);
|
|
@@ -5806,7 +5796,7 @@ function getStartAndEnd(options) {
|
|
|
5806
5796
|
endGreg.setFullYear(endYear);
|
|
5807
5797
|
}
|
|
5808
5798
|
|
|
5809
|
-
endAbs =
|
|
5799
|
+
endAbs = greg2abs(endGreg) - 1;
|
|
5810
5800
|
}
|
|
5811
5801
|
|
|
5812
5802
|
return [startAbs, endAbs];
|
|
@@ -6071,7 +6061,7 @@ class HebrewCalendar {
|
|
|
6071
6061
|
warnUnrecognizedOptions(options);
|
|
6072
6062
|
const startAbs = startAndEnd[0];
|
|
6073
6063
|
const endAbs = startAndEnd[1];
|
|
6074
|
-
const startGreg =
|
|
6064
|
+
const startGreg = abs2greg(startAbs);
|
|
6075
6065
|
|
|
6076
6066
|
if (startGreg.getFullYear() < 100) {
|
|
6077
6067
|
options.candlelighting = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "3.38.
|
|
3
|
+
"version": "3.38.1",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"pretest": "npm run build",
|
|
48
48
|
"typedef": "npx jsdoc -t node_modules/tsd-jsdoc/dist -r ./src/",
|
|
49
49
|
"lint": "eslint src",
|
|
50
|
-
"coverage-local": "nyc --concurrency 2",
|
|
50
|
+
"coverage-local": "nyc --concurrency 2 ava",
|
|
51
51
|
"coverage": "nyc --reporter=lcov ava --concurrency 4 && codecov",
|
|
52
52
|
"test": "ava --concurrency 4"
|
|
53
53
|
},
|
|
@@ -63,25 +63,25 @@
|
|
|
63
63
|
"verbose": true
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@babel/core": "^7.
|
|
67
|
-
"@babel/preset-env": "^7.
|
|
66
|
+
"@babel/core": "^7.18.5",
|
|
67
|
+
"@babel/preset-env": "^7.18.2",
|
|
68
68
|
"@babel/register": "^7.17.7",
|
|
69
69
|
"@hebcal/solar-calc": "^1.1.2",
|
|
70
70
|
"@rollup/plugin-babel": "^5.3.1",
|
|
71
71
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
72
72
|
"@rollup/plugin-json": "^4.1.0",
|
|
73
73
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
74
|
-
"ava": "^4.
|
|
74
|
+
"ava": "^4.3.0",
|
|
75
75
|
"codecov": "^3.8.3",
|
|
76
|
-
"core-js": "^3.
|
|
77
|
-
"eslint": "^8.
|
|
76
|
+
"core-js": "^3.23.1",
|
|
77
|
+
"eslint": "^8.17.0",
|
|
78
78
|
"eslint-config-google": "^0.14.0",
|
|
79
79
|
"jsdoc": "^3.6.10",
|
|
80
80
|
"jsdoc-to-markdown": "^7.1.1",
|
|
81
81
|
"nyc": "^15.1.0",
|
|
82
|
-
"rollup": "^2.
|
|
82
|
+
"rollup": "^2.75.6",
|
|
83
83
|
"rollup-plugin-terser": "^7.0.2",
|
|
84
84
|
"tsd-jsdoc": "^2.5.0",
|
|
85
|
-
"ttag-cli": "^1.9.
|
|
85
|
+
"ttag-cli": "^1.9.4"
|
|
86
86
|
}
|
|
87
87
|
}
|