@hebcal/core 5.0.5 → 5.0.7
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 +171 -113
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +164 -90
- package/dist/index.mjs +164 -90
- package/hebcal.d.ts +24 -6
- package/package.json +8 -7
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.0.
|
|
1
|
+
/*! @hebcal/core v5.0.7 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/** @private */
|
|
@@ -3706,27 +3706,68 @@ class Zmanim {
|
|
|
3706
3706
|
return this.getShaahZmanisBasedZman(4);
|
|
3707
3707
|
}
|
|
3708
3708
|
/**
|
|
3709
|
-
*
|
|
3709
|
+
* Returns an array with alot (Date) and ms in hour (number)
|
|
3710
|
+
* @private
|
|
3711
|
+
* @return {any[]}
|
|
3712
|
+
*/
|
|
3713
|
+
getTemporalHour72() {
|
|
3714
|
+
const alot72 = this.sunriseOffset(-72, false, true);
|
|
3715
|
+
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3716
|
+
const temporalHour = (tzeit72 - alot72) / 12;
|
|
3717
|
+
return [alot72, temporalHour];
|
|
3718
|
+
}
|
|
3719
|
+
/**
|
|
3720
|
+
* Returns an array with alot (Date) and ms in hour (number)
|
|
3721
|
+
* @private
|
|
3722
|
+
* @return {any[]}
|
|
3723
|
+
*/
|
|
3724
|
+
getTemporalHour16Point1() {
|
|
3725
|
+
const alot16one = this.alotHaShachar();
|
|
3726
|
+
const tzeit16one = this.tzeit(16.1);
|
|
3727
|
+
const temporalHour = (tzeit16one - alot16one) / 12;
|
|
3728
|
+
return [alot16one, temporalHour];
|
|
3729
|
+
}
|
|
3730
|
+
/**
|
|
3731
|
+
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
3732
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3733
|
+
* dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed
|
|
3734
|
+
* 72 minutes after sea-level sunset.
|
|
3710
3735
|
* @return {Date}
|
|
3711
3736
|
*/
|
|
3712
3737
|
sofZmanShmaMGA() {
|
|
3713
3738
|
// Magen Avraham
|
|
3714
|
-
const alot72 = this.
|
|
3715
|
-
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3716
|
-
const temporalHour = (tzeit72 - alot72) / 12; // ms in hour
|
|
3739
|
+
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
3717
3740
|
return new Date(alot72.getTime() + 3 * temporalHour);
|
|
3718
3741
|
}
|
|
3742
|
+
/**
|
|
3743
|
+
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
3744
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3745
|
+
* dawn to nightfall with both being 16.1° below the horizon.
|
|
3746
|
+
* @return {Date}
|
|
3747
|
+
*/
|
|
3748
|
+
sofZmanShmaMGA16Point1() {
|
|
3749
|
+
const [alot, temporalHour] = this.getTemporalHour16Point1();
|
|
3750
|
+
return new Date(alot.getTime() + 3 * temporalHour);
|
|
3751
|
+
}
|
|
3719
3752
|
/**
|
|
3720
3753
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
|
|
3721
3754
|
* @return {Date}
|
|
3722
3755
|
*/
|
|
3723
3756
|
sofZmanTfillaMGA() {
|
|
3724
3757
|
// Magen Avraham
|
|
3725
|
-
const alot72 = this.
|
|
3726
|
-
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3727
|
-
const temporalHour = (tzeit72 - alot72) / 12; // ms in hour
|
|
3758
|
+
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
3728
3759
|
return new Date(alot72.getTime() + 4 * temporalHour);
|
|
3729
3760
|
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
3763
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3764
|
+
* dawn to nightfall with both being 16.1° below the horizon.
|
|
3765
|
+
* @return {Date}
|
|
3766
|
+
*/
|
|
3767
|
+
sofZmanTfillaMGA16Point1() {
|
|
3768
|
+
const [alot, temporalHour] = this.getTemporalHour16Point1();
|
|
3769
|
+
return new Date(alot.getTime() + 4 * temporalHour);
|
|
3770
|
+
}
|
|
3730
3771
|
/**
|
|
3731
3772
|
* Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours
|
|
3732
3773
|
* @return {Date}
|
|
@@ -3879,6 +3920,54 @@ class Zmanim {
|
|
|
3879
3920
|
}
|
|
3880
3921
|
}
|
|
3881
3922
|
|
|
3923
|
+
const hour12cc = {
|
|
3924
|
+
US: 1,
|
|
3925
|
+
CA: 1,
|
|
3926
|
+
BR: 1,
|
|
3927
|
+
AU: 1,
|
|
3928
|
+
NZ: 1,
|
|
3929
|
+
DO: 1,
|
|
3930
|
+
PR: 1,
|
|
3931
|
+
GR: 1,
|
|
3932
|
+
IN: 1,
|
|
3933
|
+
KR: 1,
|
|
3934
|
+
NP: 1,
|
|
3935
|
+
ZA: 1
|
|
3936
|
+
};
|
|
3937
|
+
|
|
3938
|
+
/**
|
|
3939
|
+
* @private
|
|
3940
|
+
* @param {string} timeStr - original time like "20:30"
|
|
3941
|
+
* @param {string} suffix - "p" or "pm" or " P.M.". Add leading space if you want it
|
|
3942
|
+
* @param {CalOptions} options
|
|
3943
|
+
* @return {string}
|
|
3944
|
+
*/
|
|
3945
|
+
function reformatTimeStr(timeStr, suffix, options) {
|
|
3946
|
+
var _options$location;
|
|
3947
|
+
if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
3948
|
+
const cc = (options === null || options === void 0 || (_options$location = options.location) === null || _options$location === void 0 ? void 0 : _options$location.cc) || (options !== null && options !== void 0 && options.il ? 'IL' : 'US');
|
|
3949
|
+
const hour12 = options === null || options === void 0 ? void 0 : options.hour12;
|
|
3950
|
+
if (typeof hour12 !== 'undefined' && !hour12) {
|
|
3951
|
+
return timeStr;
|
|
3952
|
+
}
|
|
3953
|
+
if (!hour12 && typeof hour12cc[cc] === 'undefined') {
|
|
3954
|
+
return timeStr;
|
|
3955
|
+
}
|
|
3956
|
+
const hm = timeStr.split(':');
|
|
3957
|
+
let hour = parseInt(hm[0], 10);
|
|
3958
|
+
if (hour < 12 && suffix) {
|
|
3959
|
+
suffix = suffix.replace('p', 'a').replace('P', 'A');
|
|
3960
|
+
if (hour === 0) {
|
|
3961
|
+
hour = 12;
|
|
3962
|
+
}
|
|
3963
|
+
} else if (hour > 12) {
|
|
3964
|
+
hour = hour % 12;
|
|
3965
|
+
} else if (hour === 0) {
|
|
3966
|
+
hour = '00';
|
|
3967
|
+
}
|
|
3968
|
+
return `${hour}:${hm[1]}${suffix}`;
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3882
3971
|
/* eslint-disable max-len */
|
|
3883
3972
|
const FRI$3 = 5;
|
|
3884
3973
|
const SAT$3 = 6;
|
|
@@ -3888,11 +3977,10 @@ const SAT$3 = 6;
|
|
|
3888
3977
|
* @param {Event} e
|
|
3889
3978
|
* @param {HDate} hd
|
|
3890
3979
|
* @param {number} dow
|
|
3891
|
-
* @param {Location} location
|
|
3892
3980
|
* @param {CalOptions} options
|
|
3893
3981
|
* @return {Event}
|
|
3894
3982
|
*/
|
|
3895
|
-
function makeCandleEvent(e, hd, dow,
|
|
3983
|
+
function makeCandleEvent(e, hd, dow, options) {
|
|
3896
3984
|
let havdalahTitle = false;
|
|
3897
3985
|
let useHavdalahOffset = dow === SAT$3;
|
|
3898
3986
|
let mask = e ? e.getFlags() : flags.LIGHT_CANDLES;
|
|
@@ -3912,15 +4000,16 @@ function makeCandleEvent(e, hd, dow, location, options) {
|
|
|
3912
4000
|
}
|
|
3913
4001
|
// if offset is 0 or undefined, we'll use tzeit time
|
|
3914
4002
|
const offset = useHavdalahOffset ? options.havdalahMins : options.candleLightingMins;
|
|
4003
|
+
const location = options.location;
|
|
3915
4004
|
const zmanim = new Zmanim(location, hd, options.useElevation);
|
|
3916
4005
|
const time = offset ? zmanim.sunsetOffset(offset, true) : zmanim.tzeit(options.havdalahDeg);
|
|
3917
4006
|
if (isNaN(time.getTime())) {
|
|
3918
4007
|
return null; // no sunset
|
|
3919
4008
|
}
|
|
3920
4009
|
if (havdalahTitle) {
|
|
3921
|
-
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e);
|
|
4010
|
+
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e, options);
|
|
3922
4011
|
} else {
|
|
3923
|
-
return new CandleLightingEvent(hd, mask, time, location, e);
|
|
4012
|
+
return new CandleLightingEvent(hd, mask, time, location, e, options);
|
|
3924
4013
|
}
|
|
3925
4014
|
}
|
|
3926
4015
|
|
|
@@ -3933,13 +4022,18 @@ class TimedEvent extends Event {
|
|
|
3933
4022
|
* @param {Date} eventTime
|
|
3934
4023
|
* @param {Location} location
|
|
3935
4024
|
* @param {Event} linkedEvent
|
|
4025
|
+
* @param {CalOptions} options
|
|
3936
4026
|
*/
|
|
3937
|
-
constructor(date, desc, mask, eventTime, location, linkedEvent) {
|
|
4027
|
+
constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
|
|
3938
4028
|
super(date, desc, mask);
|
|
3939
4029
|
this.eventTime = Zmanim.roundTime(eventTime);
|
|
3940
4030
|
this.location = location;
|
|
3941
4031
|
const timeFormat = location.getTimeFormatter();
|
|
3942
4032
|
this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);
|
|
4033
|
+
const opts = Object.assign({
|
|
4034
|
+
location
|
|
4035
|
+
}, options);
|
|
4036
|
+
this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);
|
|
3943
4037
|
if (typeof linkedEvent !== 'undefined') {
|
|
3944
4038
|
this.linkedEvent = linkedEvent;
|
|
3945
4039
|
}
|
|
@@ -3949,7 +4043,7 @@ class TimedEvent extends Event {
|
|
|
3949
4043
|
* @return {string}
|
|
3950
4044
|
*/
|
|
3951
4045
|
render(locale) {
|
|
3952
|
-
return Locale.gettext(this.getDesc(), locale) + ': ' + this.
|
|
4046
|
+
return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;
|
|
3953
4047
|
}
|
|
3954
4048
|
/**
|
|
3955
4049
|
* Returns translation of "Candle lighting" without the time.
|
|
@@ -3986,9 +4080,10 @@ class HavdalahEvent extends TimedEvent {
|
|
|
3986
4080
|
* @param {Location} location
|
|
3987
4081
|
* @param {number} havdalahMins
|
|
3988
4082
|
* @param {Event} linkedEvent
|
|
4083
|
+
* @param {CalOptions} options
|
|
3989
4084
|
*/
|
|
3990
|
-
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent) {
|
|
3991
|
-
super(date, 'Havdalah', mask, eventTime, location, linkedEvent);
|
|
4085
|
+
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
|
|
4086
|
+
super(date, 'Havdalah', mask, eventTime, location, linkedEvent, options);
|
|
3992
4087
|
if (havdalahMins) {
|
|
3993
4088
|
this.havdalahMins = havdalahMins;
|
|
3994
4089
|
}
|
|
@@ -3998,7 +4093,7 @@ class HavdalahEvent extends TimedEvent {
|
|
|
3998
4093
|
* @return {string}
|
|
3999
4094
|
*/
|
|
4000
4095
|
render(locale) {
|
|
4001
|
-
return this.renderBrief(locale) + ': ' + this.
|
|
4096
|
+
return this.renderBrief(locale) + ': ' + this.fmtTime;
|
|
4002
4097
|
}
|
|
4003
4098
|
/**
|
|
4004
4099
|
* Returns translation of "Havdalah" without the time.
|
|
@@ -4027,9 +4122,10 @@ class CandleLightingEvent extends TimedEvent {
|
|
|
4027
4122
|
* @param {Date} eventTime
|
|
4028
4123
|
* @param {Location} location
|
|
4029
4124
|
* @param {Event} linkedEvent
|
|
4125
|
+
* @param {CalOptions} options
|
|
4030
4126
|
*/
|
|
4031
|
-
constructor(date, mask, eventTime, location, linkedEvent) {
|
|
4032
|
-
super(date, 'Candle lighting', mask, eventTime, location, linkedEvent);
|
|
4127
|
+
constructor(date, mask, eventTime, location, linkedEvent, options) {
|
|
4128
|
+
super(date, 'Candle lighting', mask, eventTime, location, linkedEvent, options);
|
|
4033
4129
|
}
|
|
4034
4130
|
/** @return {string} */
|
|
4035
4131
|
getEmoji() {
|
|
@@ -4057,14 +4153,14 @@ function makeFastStartEnd(ev, options) {
|
|
|
4057
4153
|
const zmanim = new Zmanim(location, dt, options.useElevation);
|
|
4058
4154
|
if (desc === 'Erev Tish\'a B\'Av') {
|
|
4059
4155
|
const sunset = zmanim.sunset();
|
|
4060
|
-
ev.startEvent = makeTimedEvent(hd, sunset, 'Fast begins', ev,
|
|
4156
|
+
ev.startEvent = makeTimedEvent(hd, sunset, 'Fast begins', ev, options);
|
|
4061
4157
|
} else if (desc.startsWith('Tish\'a B\'Av')) {
|
|
4062
|
-
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev,
|
|
4158
|
+
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev, options);
|
|
4063
4159
|
} else {
|
|
4064
4160
|
const dawn = zmanim.alotHaShachar();
|
|
4065
|
-
ev.startEvent = makeTimedEvent(hd, dawn, 'Fast begins', ev,
|
|
4161
|
+
ev.startEvent = makeTimedEvent(hd, dawn, 'Fast begins', ev, options);
|
|
4066
4162
|
if (dt.getDay() !== 5 && !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)) {
|
|
4067
|
-
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev,
|
|
4163
|
+
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev, options);
|
|
4068
4164
|
}
|
|
4069
4165
|
}
|
|
4070
4166
|
return ev;
|
|
@@ -4076,14 +4172,15 @@ function makeFastStartEnd(ev, options) {
|
|
|
4076
4172
|
* @param {Date} time
|
|
4077
4173
|
* @param {string} desc
|
|
4078
4174
|
* @param {Event} ev
|
|
4079
|
-
* @param {
|
|
4175
|
+
* @param {CalOptions} options
|
|
4080
4176
|
* @return {TimedEvent}
|
|
4081
4177
|
*/
|
|
4082
|
-
function makeTimedEvent(hd, time, desc, ev,
|
|
4178
|
+
function makeTimedEvent(hd, time, desc, ev, options) {
|
|
4083
4179
|
if (isNaN(time.getTime())) {
|
|
4084
4180
|
return null;
|
|
4085
4181
|
}
|
|
4086
|
-
|
|
4182
|
+
const location = options.location;
|
|
4183
|
+
return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
|
|
4087
4184
|
}
|
|
4088
4185
|
|
|
4089
4186
|
/**
|
|
@@ -4099,7 +4196,7 @@ function makeWeekdayChanukahCandleLighting(ev, hd, options) {
|
|
|
4099
4196
|
const zmanim = new Zmanim(location, hd.greg(), options.useElevation);
|
|
4100
4197
|
const candleLightingTime = zmanim.dusk();
|
|
4101
4198
|
// const candleLightingTime = zmanim.tzeit(4.6667);
|
|
4102
|
-
return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev,
|
|
4199
|
+
return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev, options);
|
|
4103
4200
|
}
|
|
4104
4201
|
|
|
4105
4202
|
/* eslint-disable camelcase */
|
|
@@ -4187,6 +4284,33 @@ class Molad {
|
|
|
4187
4284
|
getChalakim() {
|
|
4188
4285
|
return this.chalakim;
|
|
4189
4286
|
}
|
|
4287
|
+
/**
|
|
4288
|
+
* @param {string} [locale] Optional locale name (defaults to active locale)
|
|
4289
|
+
* @param {CalOptions} options
|
|
4290
|
+
* @return {string}
|
|
4291
|
+
*/
|
|
4292
|
+
render(locale, options) {
|
|
4293
|
+
locale = locale || Locale.getLocaleName();
|
|
4294
|
+
if (typeof locale === 'string') {
|
|
4295
|
+
locale = locale.toLowerCase();
|
|
4296
|
+
}
|
|
4297
|
+
const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
|
|
4298
|
+
const monthName = Locale.gettext(this.getMonthName(), locale);
|
|
4299
|
+
const dayNames = isHebrewLocale ? heDayNames : shortDayNames;
|
|
4300
|
+
const dow = dayNames[this.getDow()];
|
|
4301
|
+
const minutes = this.getMinutes();
|
|
4302
|
+
const hour = this.getHour();
|
|
4303
|
+
const chalakim = this.getChalakim();
|
|
4304
|
+
const moladStr = Locale.gettext('Molad', locale);
|
|
4305
|
+
const minutesStr = Locale.lookupTranslation('min', locale) || 'minutes';
|
|
4306
|
+
const chalakimStr = Locale.gettext('chalakim', locale);
|
|
4307
|
+
if (isHebrewLocale) {
|
|
4308
|
+
const ampm = hour < 5 ? night : hour < 12 ? morning : hour < 17 ? afternoon : hour < 21 ? evening : night;
|
|
4309
|
+
return `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` + `בְּשָׁעָה ${hour} ${ampm}, ` + `ו-${minutes} ${minutesStr} ` + `ו-${chalakim} ${chalakimStr}`;
|
|
4310
|
+
}
|
|
4311
|
+
const fmtTime = reformatTimeStr(`${hour}:00`, 'pm', options);
|
|
4312
|
+
return `${moladStr} ${monthName}: ${dow}, ${minutes} ${minutesStr} and ${chalakim} ${chalakimStr} after ${fmtTime}`;
|
|
4313
|
+
}
|
|
4190
4314
|
}
|
|
4191
4315
|
|
|
4192
4316
|
/** Represents a Molad announcement on Shabbat Mevarchim */
|
|
@@ -4195,38 +4319,21 @@ class MoladEvent extends Event {
|
|
|
4195
4319
|
* @param {HDate} date Hebrew date event occurs
|
|
4196
4320
|
* @param {number} hyear molad year
|
|
4197
4321
|
* @param {number} hmonth molad month
|
|
4322
|
+
* @param {CalOptions} options
|
|
4198
4323
|
*/
|
|
4199
|
-
constructor(date, hyear, hmonth) {
|
|
4324
|
+
constructor(date, hyear, hmonth, options) {
|
|
4200
4325
|
const m = new Molad(hyear, hmonth);
|
|
4201
4326
|
const monthName = m.getMonthName();
|
|
4202
4327
|
super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);
|
|
4203
4328
|
this.molad = m;
|
|
4329
|
+
this.options = options;
|
|
4204
4330
|
}
|
|
4205
4331
|
/**
|
|
4206
4332
|
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
4207
4333
|
* @return {string}
|
|
4208
4334
|
*/
|
|
4209
4335
|
render(locale) {
|
|
4210
|
-
|
|
4211
|
-
locale = locale || Locale.getLocaleName();
|
|
4212
|
-
if (typeof locale === 'string') {
|
|
4213
|
-
locale = locale.toLowerCase();
|
|
4214
|
-
}
|
|
4215
|
-
const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
|
|
4216
|
-
const monthName = Locale.gettext(m.getMonthName(), locale);
|
|
4217
|
-
const dayNames = isHebrewLocale ? heDayNames : shortDayNames;
|
|
4218
|
-
const dow = dayNames[m.getDow()];
|
|
4219
|
-
const minutes = m.getMinutes();
|
|
4220
|
-
const hour = m.getHour();
|
|
4221
|
-
const chalakim = m.getChalakim();
|
|
4222
|
-
const moladStr = Locale.gettext('Molad', locale);
|
|
4223
|
-
const minutesStr = Locale.lookupTranslation('min', locale) || 'minutes';
|
|
4224
|
-
const chalakimStr = Locale.gettext('chalakim', locale);
|
|
4225
|
-
if (isHebrewLocale) {
|
|
4226
|
-
const ampm = hour < 5 ? night : hour < 12 ? morning : hour < 17 ? afternoon : hour < 21 ? evening : night;
|
|
4227
|
-
return `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` + `בְּשָׁעָה ${hour} ${ampm}, ` + `ו-${minutes} ${minutesStr} ` + `ו-${chalakim} ${chalakimStr}`;
|
|
4228
|
-
}
|
|
4229
|
-
return `${moladStr} ${monthName}: ${dow}, ${minutes} ${minutesStr} and ${chalakim} ${chalakimStr} after ${hour}:00`;
|
|
4336
|
+
return this.molad.render(locale, this.options);
|
|
4230
4337
|
}
|
|
4231
4338
|
}
|
|
4232
4339
|
|
|
@@ -5809,8 +5916,10 @@ class MevarchimChodeshEvent extends Event {
|
|
|
5809
5916
|
const hyear = date.getFullYear();
|
|
5810
5917
|
const hmonth = date.getMonth();
|
|
5811
5918
|
const monNext = hmonth == HDate.monthsInYear(hyear) ? NISAN$1 : hmonth + 1;
|
|
5812
|
-
const molad = new
|
|
5813
|
-
this.memo = molad.render('en'
|
|
5919
|
+
const molad = new Molad(hyear, monNext);
|
|
5920
|
+
this.memo = molad.render('en', {
|
|
5921
|
+
hour12: false
|
|
5922
|
+
});
|
|
5814
5923
|
}
|
|
5815
5924
|
/** @return {string} */
|
|
5816
5925
|
basename() {
|
|
@@ -6164,7 +6273,7 @@ class DailyLearning {
|
|
|
6164
6273
|
}
|
|
6165
6274
|
|
|
6166
6275
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
6167
|
-
const version = '5.0.
|
|
6276
|
+
const version = '5.0.7';
|
|
6168
6277
|
|
|
6169
6278
|
const NONE$1 = 0;
|
|
6170
6279
|
const HALF = 1;
|
|
@@ -7118,20 +7227,6 @@ function getMaskFromOptions(options) {
|
|
|
7118
7227
|
}
|
|
7119
7228
|
const MASK_LIGHT_CANDLES = LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES | YOM_TOV_ENDS;
|
|
7120
7229
|
const defaultLocation = new Location(0, 0, false, 'UTC');
|
|
7121
|
-
const hour12cc = {
|
|
7122
|
-
US: 1,
|
|
7123
|
-
CA: 1,
|
|
7124
|
-
BR: 1,
|
|
7125
|
-
AU: 1,
|
|
7126
|
-
NZ: 1,
|
|
7127
|
-
DO: 1,
|
|
7128
|
-
PR: 1,
|
|
7129
|
-
GR: 1,
|
|
7130
|
-
IN: 1,
|
|
7131
|
-
KR: 1,
|
|
7132
|
-
NP: 1,
|
|
7133
|
-
ZA: 1
|
|
7134
|
-
};
|
|
7135
7230
|
|
|
7136
7231
|
/**
|
|
7137
7232
|
* @private
|
|
@@ -7386,10 +7481,10 @@ class HebrewCalendar {
|
|
|
7386
7481
|
const hmonth = hd.getMonth();
|
|
7387
7482
|
if (options.molad && dow == SAT && hmonth != ELUL && hd.getDate() >= 23 && hd.getDate() <= 29) {
|
|
7388
7483
|
const monNext = hmonth == HDate.monthsInYear(hyear) ? NISAN : hmonth + 1;
|
|
7389
|
-
evts.push(new MoladEvent(hd, hyear, monNext));
|
|
7484
|
+
evts.push(new MoladEvent(hd, hyear, monNext, options));
|
|
7390
7485
|
}
|
|
7391
7486
|
if (!candlesEv && options.candlelighting && (dow == FRI || dow == SAT)) {
|
|
7392
|
-
candlesEv = makeCandleEvent(undefined, hd, dow,
|
|
7487
|
+
candlesEv = makeCandleEvent(undefined, hd, dow, options);
|
|
7393
7488
|
if (dow === FRI && candlesEv && sedra) {
|
|
7394
7489
|
candlesEv.memo = sedra.getString(abs);
|
|
7395
7490
|
}
|
|
@@ -7556,28 +7651,7 @@ class HebrewCalendar {
|
|
|
7556
7651
|
* @return {string}
|
|
7557
7652
|
*/
|
|
7558
7653
|
static reformatTimeStr(timeStr, suffix, options) {
|
|
7559
|
-
|
|
7560
|
-
if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
7561
|
-
const cc = ((_options$location2 = options.location) === null || _options$location2 === void 0 ? void 0 : _options$location2.cc) || (options.il ? 'IL' : 'US');
|
|
7562
|
-
if (typeof options.hour12 !== 'undefined' && !options.hour12) {
|
|
7563
|
-
return timeStr;
|
|
7564
|
-
}
|
|
7565
|
-
if (!options.hour12 && typeof hour12cc[cc] === 'undefined') {
|
|
7566
|
-
return timeStr;
|
|
7567
|
-
}
|
|
7568
|
-
const hm = timeStr.split(':');
|
|
7569
|
-
let hour = parseInt(hm[0], 10);
|
|
7570
|
-
if (hour < 12 && suffix) {
|
|
7571
|
-
suffix = suffix.replace('p', 'a').replace('P', 'A');
|
|
7572
|
-
if (hour === 0) {
|
|
7573
|
-
hour = 12;
|
|
7574
|
-
}
|
|
7575
|
-
} else if (hour > 12) {
|
|
7576
|
-
hour = hour % 12;
|
|
7577
|
-
} else if (hour === 0) {
|
|
7578
|
-
hour = '00';
|
|
7579
|
-
}
|
|
7580
|
-
return `${hour}:${hm[1]}${suffix}`;
|
|
7654
|
+
return reformatTimeStr(timeStr, suffix, options);
|
|
7581
7655
|
}
|
|
7582
7656
|
|
|
7583
7657
|
/** @return {string} */
|
|
@@ -7676,7 +7750,7 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7676
7750
|
if (eFlags & options.mask || !eFlags && !options.userMask) {
|
|
7677
7751
|
if (options.candlelighting && eFlags & MASK_LIGHT_CANDLES) {
|
|
7678
7752
|
const hd = ev.getDate();
|
|
7679
|
-
candlesEv = makeCandleEvent(ev, hd, dow,
|
|
7753
|
+
candlesEv = makeCandleEvent(ev, hd, dow, options);
|
|
7680
7754
|
if (eFlags & CHANUKAH_CANDLES && candlesEv && !options.noHolidays) {
|
|
7681
7755
|
const chanukahEv = dow === FRI || dow === SAT ? candlesEv : makeWeekdayChanukahCandleLighting(ev, hd, options);
|
|
7682
7756
|
const attrs = {
|