@hebcal/core 3.29.2 → 3.29.3
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 +3998 -2382
- package/dist/bundle.min.js +2 -2
- package/dist/hdate-bundle.js +2 -2
- package/dist/hdate-bundle.min.js +2 -2
- package/dist/hdate.js +2 -2
- package/dist/hdate.mjs +2 -2
- package/dist/index.js +78 -71
- package/dist/index.mjs +78 -71
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.29.
|
|
1
|
+
/*! @hebcal/core v3.29.3 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -1966,6 +1966,13 @@ class HebrewDateEvent extends Event {
|
|
|
1966
1966
|
|
|
1967
1967
|
}
|
|
1968
1968
|
|
|
1969
|
+
var sun = {};
|
|
1970
|
+
|
|
1971
|
+
Object.defineProperty(sun, "__esModule", {
|
|
1972
|
+
value: true
|
|
1973
|
+
});
|
|
1974
|
+
var Sun_1 = sun.Sun = void 0;
|
|
1975
|
+
|
|
1969
1976
|
class Sun {
|
|
1970
1977
|
constructor(date, latitude, longitude) {
|
|
1971
1978
|
this.date = date;
|
|
@@ -1984,13 +1991,15 @@ class Sun {
|
|
|
1984
1991
|
|
|
1985
1992
|
}
|
|
1986
1993
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1994
|
+
Sun_1 = sun.Sun = Sun;
|
|
1995
|
+
|
|
1996
|
+
function formatDate(date, minutes) {
|
|
1997
|
+
const seconds = (minutes - Math.floor(minutes)) * 60;
|
|
1989
1998
|
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, minutes, seconds));
|
|
1990
|
-
}
|
|
1999
|
+
}
|
|
1991
2000
|
|
|
1992
2001
|
function calcTimeJulianCent(jd) {
|
|
1993
|
-
|
|
2002
|
+
const T = (jd - 2451545.0) / 36525.0;
|
|
1994
2003
|
return T;
|
|
1995
2004
|
}
|
|
1996
2005
|
|
|
@@ -2003,7 +2012,7 @@ function degToRad(angleDeg) {
|
|
|
2003
2012
|
}
|
|
2004
2013
|
|
|
2005
2014
|
function calcGeomMeanLongSun(t) {
|
|
2006
|
-
|
|
2015
|
+
let L0 = 280.46646 + t * (36000.76983 + t * 0.0003032);
|
|
2007
2016
|
|
|
2008
2017
|
while (L0 > 360.0) {
|
|
2009
2018
|
L0 -= 360.0;
|
|
@@ -2017,90 +2026,90 @@ function calcGeomMeanLongSun(t) {
|
|
|
2017
2026
|
}
|
|
2018
2027
|
|
|
2019
2028
|
function calcGeomMeanAnomalySun(t) {
|
|
2020
|
-
|
|
2029
|
+
const M = 357.52911 + t * (35999.05029 - 0.0001537 * t);
|
|
2021
2030
|
return M; // in degrees
|
|
2022
2031
|
}
|
|
2023
2032
|
|
|
2024
2033
|
function calcEccentricityEarthOrbit(t) {
|
|
2025
|
-
|
|
2034
|
+
const e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);
|
|
2026
2035
|
return e; // unitless
|
|
2027
2036
|
}
|
|
2028
2037
|
|
|
2029
2038
|
function calcSunEqOfCenter(t) {
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2039
|
+
const m = calcGeomMeanAnomalySun(t);
|
|
2040
|
+
const mrad = degToRad(m);
|
|
2041
|
+
const sinm = Math.sin(mrad);
|
|
2042
|
+
const sin2m = Math.sin(mrad + mrad);
|
|
2043
|
+
const sin3m = Math.sin(mrad + mrad + mrad);
|
|
2044
|
+
const C = sinm * (1.914602 - t * (0.004817 + 0.000014 * t)) + sin2m * (0.019993 - 0.000101 * t) + sin3m * 0.000289;
|
|
2036
2045
|
return C; // in degrees
|
|
2037
2046
|
}
|
|
2038
2047
|
|
|
2039
2048
|
function calcSunTrueLong(t) {
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2049
|
+
const l0 = calcGeomMeanLongSun(t);
|
|
2050
|
+
const c = calcSunEqOfCenter(t);
|
|
2051
|
+
const O = l0 + c;
|
|
2043
2052
|
return O; // in degrees
|
|
2044
2053
|
}
|
|
2045
2054
|
|
|
2046
2055
|
function calcSunApparentLong(t) {
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2056
|
+
const o = calcSunTrueLong(t);
|
|
2057
|
+
const omega = 125.04 - 1934.136 * t;
|
|
2058
|
+
const lambda = o - 0.00569 - 0.00478 * Math.sin(degToRad(omega));
|
|
2050
2059
|
return lambda; // in degrees
|
|
2051
2060
|
}
|
|
2052
2061
|
|
|
2053
2062
|
function calcMeanObliquityOfEcliptic(t) {
|
|
2054
|
-
|
|
2055
|
-
|
|
2063
|
+
const seconds = 21.448 - t * (46.8150 + t * (0.00059 - t * 0.001813));
|
|
2064
|
+
const e0 = 23.0 + (26.0 + seconds / 60.0) / 60.0;
|
|
2056
2065
|
return e0; // in degrees
|
|
2057
2066
|
}
|
|
2058
2067
|
|
|
2059
2068
|
function calcObliquityCorrection(t) {
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2069
|
+
const e0 = calcMeanObliquityOfEcliptic(t);
|
|
2070
|
+
const omega = 125.04 - 1934.136 * t;
|
|
2071
|
+
const e = e0 + 0.00256 * Math.cos(degToRad(omega));
|
|
2063
2072
|
return e; // in degrees
|
|
2064
2073
|
}
|
|
2065
2074
|
|
|
2066
2075
|
function calcSunDeclination(t) {
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2076
|
+
const e = calcObliquityCorrection(t);
|
|
2077
|
+
const lambda = calcSunApparentLong(t);
|
|
2078
|
+
const sint = Math.sin(degToRad(e)) * Math.sin(degToRad(lambda));
|
|
2079
|
+
const theta = radToDeg(Math.asin(sint));
|
|
2071
2080
|
return theta; // in degrees
|
|
2072
2081
|
}
|
|
2073
2082
|
|
|
2074
2083
|
function calcEquationOfTime(t) {
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2084
|
+
const epsilon = calcObliquityCorrection(t);
|
|
2085
|
+
const l0 = calcGeomMeanLongSun(t);
|
|
2086
|
+
const e = calcEccentricityEarthOrbit(t);
|
|
2087
|
+
const m = calcGeomMeanAnomalySun(t);
|
|
2088
|
+
let y = Math.tan(degToRad(epsilon) / 2.0);
|
|
2080
2089
|
y *= y;
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2090
|
+
const sin2l0 = Math.sin(2.0 * degToRad(l0));
|
|
2091
|
+
const sinm = Math.sin(degToRad(m));
|
|
2092
|
+
const cos2l0 = Math.cos(2.0 * degToRad(l0));
|
|
2093
|
+
const sin4l0 = Math.sin(4.0 * degToRad(l0));
|
|
2094
|
+
const sin2m = Math.sin(2.0 * degToRad(m));
|
|
2095
|
+
const Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;
|
|
2087
2096
|
return radToDeg(Etime) * 4.0; // in minutes of time
|
|
2088
2097
|
}
|
|
2089
2098
|
|
|
2090
2099
|
function calcHourAngle(angle, lat, solarDec) {
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2100
|
+
const latRad = degToRad(lat);
|
|
2101
|
+
const sdRad = degToRad(solarDec);
|
|
2102
|
+
const HAarg = Math.cos(degToRad(90 + angle)) / (Math.cos(latRad) * Math.cos(sdRad)) - Math.tan(latRad) * Math.tan(sdRad);
|
|
2103
|
+
const HA = Math.acos(HAarg);
|
|
2095
2104
|
return HA; // in radians (for sunset, use -HA)
|
|
2096
2105
|
}
|
|
2097
2106
|
|
|
2098
2107
|
function isNumber(inputVal) {
|
|
2099
|
-
|
|
2100
|
-
|
|
2108
|
+
let oneDecimal = false;
|
|
2109
|
+
const inputStr = `${inputVal}`;
|
|
2101
2110
|
|
|
2102
|
-
for (
|
|
2103
|
-
|
|
2111
|
+
for (let i = 0; i < inputStr.length; i++) {
|
|
2112
|
+
const oneChar = inputStr.charAt(i);
|
|
2104
2113
|
|
|
2105
2114
|
if (i === 0 && (oneChar === '-' || oneChar === '+')) {
|
|
2106
2115
|
continue;
|
|
@@ -2120,29 +2129,29 @@ function isNumber(inputVal) {
|
|
|
2120
2129
|
}
|
|
2121
2130
|
|
|
2122
2131
|
function getJD(date) {
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2132
|
+
let year = date.getFullYear();
|
|
2133
|
+
let month = date.getMonth() + 1;
|
|
2134
|
+
const day = date.getDate();
|
|
2126
2135
|
|
|
2127
2136
|
if (month < 3) {
|
|
2128
2137
|
year--;
|
|
2129
2138
|
month += 12;
|
|
2130
2139
|
}
|
|
2131
2140
|
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2141
|
+
const A = Math.floor(year / 100);
|
|
2142
|
+
const B = 2 - A + Math.floor(A / 4);
|
|
2143
|
+
const JD = Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + B - 1524.5;
|
|
2135
2144
|
return JD;
|
|
2136
2145
|
}
|
|
2137
2146
|
|
|
2138
2147
|
function calcSolNoon(jd, longitude, date) {
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2148
|
+
const tnoon = calcTimeJulianCent(jd - longitude / 360.0);
|
|
2149
|
+
let eqTime = calcEquationOfTime(tnoon);
|
|
2150
|
+
const solNoonOffset = 720.0 - longitude * 4 - eqTime; // in minutes
|
|
2142
2151
|
|
|
2143
|
-
|
|
2152
|
+
const newt = calcTimeJulianCent(jd + solNoonOffset / 1440.0);
|
|
2144
2153
|
eqTime = calcEquationOfTime(newt);
|
|
2145
|
-
|
|
2154
|
+
let solNoonLocal = 720 - longitude * 4 - eqTime; // in minutes
|
|
2146
2155
|
|
|
2147
2156
|
while (solNoonLocal < 0.0) {
|
|
2148
2157
|
solNoonLocal += 1440.0;
|
|
@@ -2156,22 +2165,22 @@ function calcSolNoon(jd, longitude, date) {
|
|
|
2156
2165
|
}
|
|
2157
2166
|
|
|
2158
2167
|
function calcSunriseSetUTC(rise, angle, JD, latitude, longitude) {
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2168
|
+
const t = calcTimeJulianCent(JD);
|
|
2169
|
+
const eqTime = calcEquationOfTime(t);
|
|
2170
|
+
const solarDec = calcSunDeclination(t);
|
|
2171
|
+
let hourAngle = calcHourAngle(angle, latitude, solarDec); //alert("HA = " + radToDeg(hourAngle));
|
|
2163
2172
|
|
|
2164
2173
|
if (!rise) hourAngle = -hourAngle;
|
|
2165
|
-
|
|
2166
|
-
|
|
2174
|
+
const delta = longitude + radToDeg(hourAngle);
|
|
2175
|
+
const timeUTC = 720 - 4.0 * delta - eqTime; // in minutes
|
|
2167
2176
|
|
|
2168
2177
|
return timeUTC;
|
|
2169
2178
|
}
|
|
2170
2179
|
|
|
2171
2180
|
function calcSunriseSet(rise, angle, JD, date, latitude, longitude) // rise = 1 for sunrise, 0 for sunset
|
|
2172
2181
|
{
|
|
2173
|
-
|
|
2174
|
-
|
|
2182
|
+
const timeUTC = calcSunriseSetUTC(rise, angle, JD, latitude, longitude);
|
|
2183
|
+
const newTimeUTC = calcSunriseSetUTC(rise, angle, JD + timeUTC / 1440.0, latitude, longitude);
|
|
2175
2184
|
|
|
2176
2185
|
if (isNumber(newTimeUTC)) {
|
|
2177
2186
|
return formatDate(date, newTimeUTC);
|
|
@@ -2181,8 +2190,6 @@ function calcSunriseSet(rise, angle, JD, date, latitude, longitude) // rise = 1
|
|
|
2181
2190
|
}
|
|
2182
2191
|
}
|
|
2183
2192
|
|
|
2184
|
-
var sun = Sun;
|
|
2185
|
-
|
|
2186
2193
|
const _formatters = {};
|
|
2187
2194
|
/**
|
|
2188
2195
|
* @private
|
|
@@ -2319,7 +2326,7 @@ class Zmanim {
|
|
|
2319
2326
|
|
|
2320
2327
|
const dt = greg.isDate(date) ? date : HDate$1.isHDate(date) ? date.greg() : throwTypeError$1(`invalid date: ${date}`);
|
|
2321
2328
|
this.date = dt;
|
|
2322
|
-
this.sun = new
|
|
2329
|
+
this.sun = new Sun_1(this.date, latitude, longitude);
|
|
2323
2330
|
this.latitude = latitude;
|
|
2324
2331
|
this.longitude = longitude;
|
|
2325
2332
|
}
|
|
@@ -4684,7 +4691,7 @@ function getHolidaysForYear(year) {
|
|
|
4684
4691
|
return h;
|
|
4685
4692
|
}
|
|
4686
4693
|
|
|
4687
|
-
var version="3.29.
|
|
4694
|
+
var version="3.29.3";
|
|
4688
4695
|
|
|
4689
4696
|
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4690
4697
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v3.29.
|
|
1
|
+
/*! @hebcal/core v3.29.3 */
|
|
2
2
|
/*
|
|
3
3
|
Hebcal - A Jewish Calendar Generator
|
|
4
4
|
Copyright (c) 1994-2020 Danny Sadinoff
|
|
@@ -1962,6 +1962,13 @@ class HebrewDateEvent extends Event {
|
|
|
1962
1962
|
|
|
1963
1963
|
}
|
|
1964
1964
|
|
|
1965
|
+
var sun = {};
|
|
1966
|
+
|
|
1967
|
+
Object.defineProperty(sun, "__esModule", {
|
|
1968
|
+
value: true
|
|
1969
|
+
});
|
|
1970
|
+
var Sun_1 = sun.Sun = void 0;
|
|
1971
|
+
|
|
1965
1972
|
class Sun {
|
|
1966
1973
|
constructor(date, latitude, longitude) {
|
|
1967
1974
|
this.date = date;
|
|
@@ -1980,13 +1987,15 @@ class Sun {
|
|
|
1980
1987
|
|
|
1981
1988
|
}
|
|
1982
1989
|
|
|
1983
|
-
|
|
1984
|
-
|
|
1990
|
+
Sun_1 = sun.Sun = Sun;
|
|
1991
|
+
|
|
1992
|
+
function formatDate(date, minutes) {
|
|
1993
|
+
const seconds = (minutes - Math.floor(minutes)) * 60;
|
|
1985
1994
|
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 0, minutes, seconds));
|
|
1986
|
-
}
|
|
1995
|
+
}
|
|
1987
1996
|
|
|
1988
1997
|
function calcTimeJulianCent(jd) {
|
|
1989
|
-
|
|
1998
|
+
const T = (jd - 2451545.0) / 36525.0;
|
|
1990
1999
|
return T;
|
|
1991
2000
|
}
|
|
1992
2001
|
|
|
@@ -1999,7 +2008,7 @@ function degToRad(angleDeg) {
|
|
|
1999
2008
|
}
|
|
2000
2009
|
|
|
2001
2010
|
function calcGeomMeanLongSun(t) {
|
|
2002
|
-
|
|
2011
|
+
let L0 = 280.46646 + t * (36000.76983 + t * 0.0003032);
|
|
2003
2012
|
|
|
2004
2013
|
while (L0 > 360.0) {
|
|
2005
2014
|
L0 -= 360.0;
|
|
@@ -2013,90 +2022,90 @@ function calcGeomMeanLongSun(t) {
|
|
|
2013
2022
|
}
|
|
2014
2023
|
|
|
2015
2024
|
function calcGeomMeanAnomalySun(t) {
|
|
2016
|
-
|
|
2025
|
+
const M = 357.52911 + t * (35999.05029 - 0.0001537 * t);
|
|
2017
2026
|
return M; // in degrees
|
|
2018
2027
|
}
|
|
2019
2028
|
|
|
2020
2029
|
function calcEccentricityEarthOrbit(t) {
|
|
2021
|
-
|
|
2030
|
+
const e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);
|
|
2022
2031
|
return e; // unitless
|
|
2023
2032
|
}
|
|
2024
2033
|
|
|
2025
2034
|
function calcSunEqOfCenter(t) {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2035
|
+
const m = calcGeomMeanAnomalySun(t);
|
|
2036
|
+
const mrad = degToRad(m);
|
|
2037
|
+
const sinm = Math.sin(mrad);
|
|
2038
|
+
const sin2m = Math.sin(mrad + mrad);
|
|
2039
|
+
const sin3m = Math.sin(mrad + mrad + mrad);
|
|
2040
|
+
const C = sinm * (1.914602 - t * (0.004817 + 0.000014 * t)) + sin2m * (0.019993 - 0.000101 * t) + sin3m * 0.000289;
|
|
2032
2041
|
return C; // in degrees
|
|
2033
2042
|
}
|
|
2034
2043
|
|
|
2035
2044
|
function calcSunTrueLong(t) {
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2045
|
+
const l0 = calcGeomMeanLongSun(t);
|
|
2046
|
+
const c = calcSunEqOfCenter(t);
|
|
2047
|
+
const O = l0 + c;
|
|
2039
2048
|
return O; // in degrees
|
|
2040
2049
|
}
|
|
2041
2050
|
|
|
2042
2051
|
function calcSunApparentLong(t) {
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2052
|
+
const o = calcSunTrueLong(t);
|
|
2053
|
+
const omega = 125.04 - 1934.136 * t;
|
|
2054
|
+
const lambda = o - 0.00569 - 0.00478 * Math.sin(degToRad(omega));
|
|
2046
2055
|
return lambda; // in degrees
|
|
2047
2056
|
}
|
|
2048
2057
|
|
|
2049
2058
|
function calcMeanObliquityOfEcliptic(t) {
|
|
2050
|
-
|
|
2051
|
-
|
|
2059
|
+
const seconds = 21.448 - t * (46.8150 + t * (0.00059 - t * 0.001813));
|
|
2060
|
+
const e0 = 23.0 + (26.0 + seconds / 60.0) / 60.0;
|
|
2052
2061
|
return e0; // in degrees
|
|
2053
2062
|
}
|
|
2054
2063
|
|
|
2055
2064
|
function calcObliquityCorrection(t) {
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2065
|
+
const e0 = calcMeanObliquityOfEcliptic(t);
|
|
2066
|
+
const omega = 125.04 - 1934.136 * t;
|
|
2067
|
+
const e = e0 + 0.00256 * Math.cos(degToRad(omega));
|
|
2059
2068
|
return e; // in degrees
|
|
2060
2069
|
}
|
|
2061
2070
|
|
|
2062
2071
|
function calcSunDeclination(t) {
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2072
|
+
const e = calcObliquityCorrection(t);
|
|
2073
|
+
const lambda = calcSunApparentLong(t);
|
|
2074
|
+
const sint = Math.sin(degToRad(e)) * Math.sin(degToRad(lambda));
|
|
2075
|
+
const theta = radToDeg(Math.asin(sint));
|
|
2067
2076
|
return theta; // in degrees
|
|
2068
2077
|
}
|
|
2069
2078
|
|
|
2070
2079
|
function calcEquationOfTime(t) {
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2080
|
+
const epsilon = calcObliquityCorrection(t);
|
|
2081
|
+
const l0 = calcGeomMeanLongSun(t);
|
|
2082
|
+
const e = calcEccentricityEarthOrbit(t);
|
|
2083
|
+
const m = calcGeomMeanAnomalySun(t);
|
|
2084
|
+
let y = Math.tan(degToRad(epsilon) / 2.0);
|
|
2076
2085
|
y *= y;
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2086
|
+
const sin2l0 = Math.sin(2.0 * degToRad(l0));
|
|
2087
|
+
const sinm = Math.sin(degToRad(m));
|
|
2088
|
+
const cos2l0 = Math.cos(2.0 * degToRad(l0));
|
|
2089
|
+
const sin4l0 = Math.sin(4.0 * degToRad(l0));
|
|
2090
|
+
const sin2m = Math.sin(2.0 * degToRad(m));
|
|
2091
|
+
const Etime = y * sin2l0 - 2.0 * e * sinm + 4.0 * e * y * sinm * cos2l0 - 0.5 * y * y * sin4l0 - 1.25 * e * e * sin2m;
|
|
2083
2092
|
return radToDeg(Etime) * 4.0; // in minutes of time
|
|
2084
2093
|
}
|
|
2085
2094
|
|
|
2086
2095
|
function calcHourAngle(angle, lat, solarDec) {
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2096
|
+
const latRad = degToRad(lat);
|
|
2097
|
+
const sdRad = degToRad(solarDec);
|
|
2098
|
+
const HAarg = Math.cos(degToRad(90 + angle)) / (Math.cos(latRad) * Math.cos(sdRad)) - Math.tan(latRad) * Math.tan(sdRad);
|
|
2099
|
+
const HA = Math.acos(HAarg);
|
|
2091
2100
|
return HA; // in radians (for sunset, use -HA)
|
|
2092
2101
|
}
|
|
2093
2102
|
|
|
2094
2103
|
function isNumber(inputVal) {
|
|
2095
|
-
|
|
2096
|
-
|
|
2104
|
+
let oneDecimal = false;
|
|
2105
|
+
const inputStr = `${inputVal}`;
|
|
2097
2106
|
|
|
2098
|
-
for (
|
|
2099
|
-
|
|
2107
|
+
for (let i = 0; i < inputStr.length; i++) {
|
|
2108
|
+
const oneChar = inputStr.charAt(i);
|
|
2100
2109
|
|
|
2101
2110
|
if (i === 0 && (oneChar === '-' || oneChar === '+')) {
|
|
2102
2111
|
continue;
|
|
@@ -2116,29 +2125,29 @@ function isNumber(inputVal) {
|
|
|
2116
2125
|
}
|
|
2117
2126
|
|
|
2118
2127
|
function getJD(date) {
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2128
|
+
let year = date.getFullYear();
|
|
2129
|
+
let month = date.getMonth() + 1;
|
|
2130
|
+
const day = date.getDate();
|
|
2122
2131
|
|
|
2123
2132
|
if (month < 3) {
|
|
2124
2133
|
year--;
|
|
2125
2134
|
month += 12;
|
|
2126
2135
|
}
|
|
2127
2136
|
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2137
|
+
const A = Math.floor(year / 100);
|
|
2138
|
+
const B = 2 - A + Math.floor(A / 4);
|
|
2139
|
+
const JD = Math.floor(365.25 * (year + 4716)) + Math.floor(30.6001 * (month + 1)) + day + B - 1524.5;
|
|
2131
2140
|
return JD;
|
|
2132
2141
|
}
|
|
2133
2142
|
|
|
2134
2143
|
function calcSolNoon(jd, longitude, date) {
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2144
|
+
const tnoon = calcTimeJulianCent(jd - longitude / 360.0);
|
|
2145
|
+
let eqTime = calcEquationOfTime(tnoon);
|
|
2146
|
+
const solNoonOffset = 720.0 - longitude * 4 - eqTime; // in minutes
|
|
2138
2147
|
|
|
2139
|
-
|
|
2148
|
+
const newt = calcTimeJulianCent(jd + solNoonOffset / 1440.0);
|
|
2140
2149
|
eqTime = calcEquationOfTime(newt);
|
|
2141
|
-
|
|
2150
|
+
let solNoonLocal = 720 - longitude * 4 - eqTime; // in minutes
|
|
2142
2151
|
|
|
2143
2152
|
while (solNoonLocal < 0.0) {
|
|
2144
2153
|
solNoonLocal += 1440.0;
|
|
@@ -2152,22 +2161,22 @@ function calcSolNoon(jd, longitude, date) {
|
|
|
2152
2161
|
}
|
|
2153
2162
|
|
|
2154
2163
|
function calcSunriseSetUTC(rise, angle, JD, latitude, longitude) {
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2164
|
+
const t = calcTimeJulianCent(JD);
|
|
2165
|
+
const eqTime = calcEquationOfTime(t);
|
|
2166
|
+
const solarDec = calcSunDeclination(t);
|
|
2167
|
+
let hourAngle = calcHourAngle(angle, latitude, solarDec); //alert("HA = " + radToDeg(hourAngle));
|
|
2159
2168
|
|
|
2160
2169
|
if (!rise) hourAngle = -hourAngle;
|
|
2161
|
-
|
|
2162
|
-
|
|
2170
|
+
const delta = longitude + radToDeg(hourAngle);
|
|
2171
|
+
const timeUTC = 720 - 4.0 * delta - eqTime; // in minutes
|
|
2163
2172
|
|
|
2164
2173
|
return timeUTC;
|
|
2165
2174
|
}
|
|
2166
2175
|
|
|
2167
2176
|
function calcSunriseSet(rise, angle, JD, date, latitude, longitude) // rise = 1 for sunrise, 0 for sunset
|
|
2168
2177
|
{
|
|
2169
|
-
|
|
2170
|
-
|
|
2178
|
+
const timeUTC = calcSunriseSetUTC(rise, angle, JD, latitude, longitude);
|
|
2179
|
+
const newTimeUTC = calcSunriseSetUTC(rise, angle, JD + timeUTC / 1440.0, latitude, longitude);
|
|
2171
2180
|
|
|
2172
2181
|
if (isNumber(newTimeUTC)) {
|
|
2173
2182
|
return formatDate(date, newTimeUTC);
|
|
@@ -2177,8 +2186,6 @@ function calcSunriseSet(rise, angle, JD, date, latitude, longitude) // rise = 1
|
|
|
2177
2186
|
}
|
|
2178
2187
|
}
|
|
2179
2188
|
|
|
2180
|
-
var sun = Sun;
|
|
2181
|
-
|
|
2182
2189
|
const _formatters = {};
|
|
2183
2190
|
/**
|
|
2184
2191
|
* @private
|
|
@@ -2315,7 +2322,7 @@ class Zmanim {
|
|
|
2315
2322
|
|
|
2316
2323
|
const dt = greg.isDate(date) ? date : HDate$1.isHDate(date) ? date.greg() : throwTypeError$1(`invalid date: ${date}`);
|
|
2317
2324
|
this.date = dt;
|
|
2318
|
-
this.sun = new
|
|
2325
|
+
this.sun = new Sun_1(this.date, latitude, longitude);
|
|
2319
2326
|
this.latitude = latitude;
|
|
2320
2327
|
this.longitude = longitude;
|
|
2321
2328
|
}
|
|
@@ -4680,7 +4687,7 @@ function getHolidaysForYear(year) {
|
|
|
4680
4687
|
return h;
|
|
4681
4688
|
}
|
|
4682
4689
|
|
|
4683
|
-
var version="3.29.
|
|
4690
|
+
var version="3.29.3";
|
|
4684
4691
|
|
|
4685
4692
|
var headers$1={"plural-forms":"nplurals=2; plural=(n > 1);",language:"en_CA@ashkenazi"};var contexts$1={"":{Berachot:["Berachos"],Shabbat:["Shabbos"],Taanit:["Taanis"],Yevamot:["Yevamos"],Ketubot:["Kesubos"],"Baba Batra":["Baba Basra"],Makkot:["Makkos"],Shevuot:["Shevuos"],Horayot:["Horayos"],Menachot:["Menachos"],Bechorot:["Bechoros"],Keritot:["Kerisos"],Midot:["Midos"],"Achrei Mot":["Achrei Mos"],Bechukotai:["Bechukosai"],"Beha'alotcha":["Beha'aloscha"],Bereshit:["Bereshis"],Chukat:["Chukas"],"Erev Shavuot":["Erev Shavuos"],"Erev Sukkot":["Erev Sukkos"],"Ki Tavo":["Ki Savo"],"Ki Teitzei":["Ki Seitzei"],"Ki Tisa":["Ki Sisa"],Matot:["Matos"],"Purim Katan":["Purim Koton"],Tazria:["Sazria"],"Shabbat Chazon":["Shabbos Chazon"],"Shabbat HaChodesh":["Shabbos HaChodesh"],"Shabbat HaGadol":["Shabbos HaGadol"],"Shabbat Nachamu":["Shabbos Nachamu"],"Shabbat Parah":["Shabbos Parah"],"Shabbat Shekalim":["Shabbos Shekalim"],"Shabbat Shuva":["Shabbos Shuvah"],"Shabbat Zachor":["Shabbos Zachor"],Shavuot:["Shavuos"],"Shavuot I":["Shavuos I"],"Shavuot II":["Shavuos II"],Shemot:["Shemos"],"Shmini Atzeret":["Shmini Atzeres"],"Simchat Torah":["Simchas Torah"],Sukkot:["Sukkos"],"Sukkot I":["Sukkos I"],"Sukkot II":["Sukkos II"],"Sukkot II (CH''M)":["Sukkos II (CH''M)"],"Sukkot III (CH''M)":["Sukkos III (CH''M)"],"Sukkot IV (CH''M)":["Sukkos IV (CH''M)"],"Sukkot V (CH''M)":["Sukkos V (CH''M)"],"Sukkot VI (CH''M)":["Sukkos VI (CH''M)"],"Sukkot VII (Hoshana Raba)":["Sukkos VII (Hoshana Raba)"],"Ta'anit Bechorot":["Ta'anis Bechoros"],"Ta'anit Esther":["Ta'anis Esther"],Toldot:["Toldos"],Vaetchanan:["Vaeschanan"],Yitro:["Yisro"],"Vezot Haberakhah":["Vezos Haberakhah"],Parashat:["Parshas"],"Leil Selichot":["Leil Selichos"],"Shabbat Mevarchim Chodesh":["Shabbos Mevorchim Chodesh"],"Shabbat Shirah":["Shabbos Shirah"],Tevet:["Teves"],"Asara B'Tevet":["Asara B'Teves"]}};var poAshkenazi = {headers:headers$1,contexts:contexts$1};
|
|
4686
4693
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.3",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"@babel/core": "^7.16.0",
|
|
74
74
|
"@babel/preset-env": "^7.16.4",
|
|
75
75
|
"@babel/register": "^7.16.0",
|
|
76
|
-
"@hebcal/solar-calc": "^1.0
|
|
76
|
+
"@hebcal/solar-calc": "^1.1.0",
|
|
77
77
|
"@rollup/plugin-babel": "^5.3.0",
|
|
78
78
|
"@rollup/plugin-commonjs": "^21.0.1",
|
|
79
79
|
"@rollup/plugin-json": "^4.1.0",
|
|
80
80
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
81
81
|
"ava": "^3.15.0",
|
|
82
|
-
"core-js": "^3.19.
|
|
82
|
+
"core-js": "^3.19.2",
|
|
83
83
|
"eslint": "^8.3.0",
|
|
84
84
|
"eslint-config-google": "^0.14.0",
|
|
85
85
|
"jsdoc": "^3.6.7",
|