@hebcal/core 5.8.10 → 5.8.12
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/CalOptions.d.ts +1 -3
- package/dist/DailyLearning.d.ts +9 -3
- package/dist/bundle.js +116 -96
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +5 -5
- package/dist/bundle.min.js.map +1 -1
- package/dist/candles.d.ts +2 -2
- package/dist/esm/CalOptions.d.ts +1 -3
- package/dist/esm/DailyLearning.d.ts +9 -3
- package/dist/esm/DailyLearning.js +14 -6
- package/dist/esm/DailyLearning.js.map +1 -1
- package/dist/esm/HebrewDateEvent.js +5 -5
- package/dist/esm/HebrewDateEvent.js.map +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/ParshaEvent.js.map +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +10 -2
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.d.ts +2 -2
- package/dist/esm/candles.js +3 -3
- package/dist/esm/candles.js.map +1 -1
- package/dist/esm/event.js +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +4 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +1 -1
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +3 -3
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/omer.js +3 -3
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +2 -2
- package/dist/esm/parshaName.js.map +1 -1
- package/dist/esm/parshaYear.js +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +3 -3
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.js +1 -1
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/staticHolidays.js.map +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/tachanun.js.map +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/esm/zmanim.js.map +1 -1
- package/dist/index.cjs +39 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/pkgVersion.d.ts +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.8.
|
|
1
|
+
/*! @hebcal/core v5.8.12, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var hdate = require('@hebcal/hdate');
|
|
@@ -6,7 +6,7 @@ var noaa = require('@hebcal/noaa');
|
|
|
6
6
|
require('temporal-polyfill/global');
|
|
7
7
|
|
|
8
8
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
9
|
-
const version = '5.8.
|
|
9
|
+
const version = '5.8.12';
|
|
10
10
|
|
|
11
11
|
var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat": ["Shabbos"], "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"], "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"], "Asara B'Tevet": ["Asara B’Teves"], "Alot HaShachar": ["Alos HaShachar"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot hayom": ["Chatzos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Birkat Hachamah": ["Birkas Hachamah"], "Shushan Purim Katan": ["Shushan Purim Koton"] } } };
|
|
12
12
|
|
|
@@ -283,8 +283,8 @@ class HebrewDateEvent extends Event {
|
|
|
283
283
|
* console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
284
284
|
*/
|
|
285
285
|
render(locale) {
|
|
286
|
-
const locale1 = locale === null || locale ===
|
|
287
|
-
const locale0 = locale1 !== null && locale1 !==
|
|
286
|
+
const locale1 = locale === null || locale === undefined ? undefined : locale.toLowerCase();
|
|
287
|
+
const locale0 = locale1 !== null && locale1 !== undefined ? locale1 : hdate.Locale.getLocaleName();
|
|
288
288
|
const hd = this.getDate();
|
|
289
289
|
switch (locale0) {
|
|
290
290
|
case 'h':
|
|
@@ -317,8 +317,8 @@ class HebrewDateEvent extends Event {
|
|
|
317
317
|
* console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
|
|
318
318
|
*/
|
|
319
319
|
renderBrief(locale) {
|
|
320
|
-
const locale1 = locale === null || locale ===
|
|
321
|
-
const locale0 = locale1 !== null && locale1 !==
|
|
320
|
+
const locale1 = locale === null || locale === undefined ? undefined : locale.toLowerCase();
|
|
321
|
+
const locale0 = locale1 !== null && locale1 !== undefined ? locale1 : hdate.Locale.getLocaleName();
|
|
322
322
|
const hd = this.getDate();
|
|
323
323
|
if (hd.getMonth() === hdate.months.TISHREI && hd.getDate() === 1) {
|
|
324
324
|
return this.render(locale0);
|
|
@@ -1225,8 +1225,8 @@ function reformatTimeStr(timeStr, suffix, options) {
|
|
|
1225
1225
|
var _a;
|
|
1226
1226
|
if (typeof timeStr !== 'string')
|
|
1227
1227
|
throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
1228
|
-
const cc = ((_a = options === null || options ===
|
|
1229
|
-
const hour12 = options === null || options ===
|
|
1228
|
+
const cc = ((_a = options === null || options === undefined ? undefined : options.location) === null || _a === undefined ? undefined : _a.getCountryCode()) || ((options === null || options === undefined ? undefined : options.il) ? 'IL' : 'US');
|
|
1229
|
+
const hour12 = options === null || options === undefined ? undefined : options.hour12;
|
|
1230
1230
|
if (typeof hour12 !== 'undefined' && !hour12) {
|
|
1231
1231
|
return timeStr;
|
|
1232
1232
|
}
|
|
@@ -2257,7 +2257,7 @@ function makeTimedEvent(ev, time, desc, options) {
|
|
|
2257
2257
|
const hd = ev.getDate();
|
|
2258
2258
|
return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
|
|
2259
2259
|
}
|
|
2260
|
-
class TimedChanukahEvent extends
|
|
2260
|
+
class TimedChanukahEvent extends ChanukahEvent {
|
|
2261
2261
|
constructor(date, desc, mask, eventTime, location) {
|
|
2262
2262
|
super(date, desc, mask);
|
|
2263
2263
|
this.eventTime = Zmanim.roundTime(eventTime);
|
|
@@ -2366,7 +2366,7 @@ class Molad {
|
|
|
2366
2366
|
*/
|
|
2367
2367
|
render(locale, options) {
|
|
2368
2368
|
var _a;
|
|
2369
|
-
locale = locale !== null && locale !==
|
|
2369
|
+
locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
|
|
2370
2370
|
if (typeof locale === 'string') {
|
|
2371
2371
|
locale = locale.toLowerCase();
|
|
2372
2372
|
}
|
|
@@ -2378,7 +2378,7 @@ class Molad {
|
|
|
2378
2378
|
const hour = this.getHour();
|
|
2379
2379
|
const chalakim = this.getChalakim();
|
|
2380
2380
|
const moladStr = hdate.Locale.gettext('Molad', locale);
|
|
2381
|
-
const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !==
|
|
2381
|
+
const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !== undefined ? _a : 'minutes';
|
|
2382
2382
|
const chalakimStr = hdate.Locale.gettext('chalakim', locale);
|
|
2383
2383
|
if (isHebrewLocale) {
|
|
2384
2384
|
const ampm = getHebrewTimeOfDay(hour);
|
|
@@ -2448,7 +2448,7 @@ class OmerEvent extends Event {
|
|
|
2448
2448
|
* @param [locale] Optional locale name (defaults to active locale).
|
|
2449
2449
|
*/
|
|
2450
2450
|
render(locale) {
|
|
2451
|
-
locale = locale !== null && locale !==
|
|
2451
|
+
locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
|
|
2452
2452
|
if (typeof locale === 'string') {
|
|
2453
2453
|
locale = locale.toLowerCase();
|
|
2454
2454
|
}
|
|
@@ -2484,7 +2484,7 @@ class OmerEvent extends Event {
|
|
|
2484
2484
|
* @param locale
|
|
2485
2485
|
*/
|
|
2486
2486
|
getTodayIs(locale) {
|
|
2487
|
-
locale = locale !== null && locale !==
|
|
2487
|
+
locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
|
|
2488
2488
|
if (typeof locale === 'string') {
|
|
2489
2489
|
locale = locale.toLowerCase();
|
|
2490
2490
|
}
|
|
@@ -2502,7 +2502,7 @@ class OmerEvent extends Event {
|
|
|
2502
2502
|
|
|
2503
2503
|
/** @private */
|
|
2504
2504
|
function renderParshaName(parsha, locale) {
|
|
2505
|
-
const locale0 = locale !== null && locale !==
|
|
2505
|
+
const locale0 = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
|
|
2506
2506
|
let name = hdate.Locale.gettext(parsha[0], locale0);
|
|
2507
2507
|
if (parsha.length === 2) {
|
|
2508
2508
|
const hyphen = locale0 === 'he' ? '־' : '-';
|
|
@@ -3809,27 +3809,35 @@ const cals = new Map();
|
|
|
3809
3809
|
class DailyLearning {
|
|
3810
3810
|
/**
|
|
3811
3811
|
* Register a new learning calendar.
|
|
3812
|
+
* @param name case insensitive
|
|
3812
3813
|
*/
|
|
3813
3814
|
static addCalendar(name, calendar) {
|
|
3814
3815
|
if (typeof calendar !== 'function') {
|
|
3815
3816
|
throw new TypeError(`Invalid calendar function: ${calendar}`);
|
|
3816
3817
|
}
|
|
3817
|
-
cals.set(name, calendar);
|
|
3818
|
+
cals.set(name.toLowerCase(), calendar);
|
|
3818
3819
|
}
|
|
3819
3820
|
/**
|
|
3820
3821
|
* Returns an event from daily calendar for a given date. Returns `null` if there
|
|
3821
3822
|
* is no learning from this calendar on this date.
|
|
3822
|
-
* @param name
|
|
3823
|
-
* @param hd
|
|
3824
|
-
* @param il
|
|
3823
|
+
* @param name case insensitive
|
|
3824
|
+
* @param hd Hebrew Date
|
|
3825
|
+
* @param il true for Israel, false for Diaspora
|
|
3825
3826
|
*/
|
|
3826
3827
|
static lookup(name, hd, il) {
|
|
3827
|
-
const fn = cals.get(name);
|
|
3828
|
+
const fn = cals.get(name.toLowerCase());
|
|
3828
3829
|
if (typeof fn === 'function') {
|
|
3829
3830
|
return fn(hd, il);
|
|
3830
3831
|
}
|
|
3831
3832
|
return null;
|
|
3832
3833
|
}
|
|
3834
|
+
/**
|
|
3835
|
+
* Tests to see if learning calendar has been registered
|
|
3836
|
+
* @param name case insensitive
|
|
3837
|
+
*/
|
|
3838
|
+
static has(name) {
|
|
3839
|
+
return cals.has(name);
|
|
3840
|
+
}
|
|
3833
3841
|
/** Returns the names of all calendars registered */
|
|
3834
3842
|
static getCalendars() {
|
|
3835
3843
|
return Array.from(cals.keys());
|
|
@@ -4400,6 +4408,14 @@ function warnUnrecognizedOptions(options) {
|
|
|
4400
4408
|
unrecognizedAlreadyWarned.add(k);
|
|
4401
4409
|
}
|
|
4402
4410
|
}
|
|
4411
|
+
if (options.dailyLearning) {
|
|
4412
|
+
for (const k of Object.keys(options.dailyLearning)) {
|
|
4413
|
+
if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(k)) {
|
|
4414
|
+
console.warn(`Ignoring unrecognized DailyLearning calendar: ${k}`);
|
|
4415
|
+
unrecognizedAlreadyWarned.add(k);
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4403
4419
|
}
|
|
4404
4420
|
const israelCityOffset = {
|
|
4405
4421
|
Jerusalem: 40,
|
|
@@ -4495,7 +4511,7 @@ function getMaskFromOptions(options) {
|
|
|
4495
4511
|
if (typeof options.mask === 'number') {
|
|
4496
4512
|
return setOptionsFromMask(options);
|
|
4497
4513
|
}
|
|
4498
|
-
const il = options.il || ((_a = options.location) === null || _a ===
|
|
4514
|
+
const il = options.il || ((_a = options.location) === null || _a === undefined ? undefined : _a.getIsrael()) || false;
|
|
4499
4515
|
let mask = 0;
|
|
4500
4516
|
// default options
|
|
4501
4517
|
if (!options.noHolidays) {
|
|
@@ -5076,6 +5092,7 @@ Object.defineProperty(exports, "NOAACalculator", {
|
|
|
5076
5092
|
});
|
|
5077
5093
|
exports.AsaraBTevetEvent = AsaraBTevetEvent;
|
|
5078
5094
|
exports.CandleLightingEvent = CandleLightingEvent;
|
|
5095
|
+
exports.ChanukahEvent = ChanukahEvent;
|
|
5079
5096
|
exports.DailyLearning = DailyLearning;
|
|
5080
5097
|
exports.Event = Event;
|
|
5081
5098
|
exports.FastDayEvent = FastDayEvent;
|
|
@@ -5092,7 +5109,9 @@ exports.ParshaEvent = ParshaEvent;
|
|
|
5092
5109
|
exports.RoshChodeshEvent = RoshChodeshEvent;
|
|
5093
5110
|
exports.RoshHashanaEvent = RoshHashanaEvent;
|
|
5094
5111
|
exports.Sedra = Sedra;
|
|
5112
|
+
exports.TimedChanukahEvent = TimedChanukahEvent;
|
|
5095
5113
|
exports.TimedEvent = TimedEvent;
|
|
5114
|
+
exports.YomKippurKatanEvent = YomKippurKatanEvent;
|
|
5096
5115
|
exports.Zmanim = Zmanim;
|
|
5097
5116
|
exports.flags = flags;
|
|
5098
5117
|
exports.getHolidaysOnDate = getHolidaysOnDate;
|