@hebcal/core 5.0.6 → 5.0.8
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 +99 -58
- package/dist/bundle.js +222 -126
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +215 -103
- package/dist/index.mjs +215 -103
- package/hebcal.d.ts +30 -7
- package/package.json +6 -6
- package/po/ashkenazi.po +9 -9
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.0.
|
|
1
|
+
/*! @hebcal/core v5.0.8 */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/** @private */
|
|
@@ -1272,7 +1272,8 @@ class HDate {
|
|
|
1272
1272
|
render(locale = null, showYear = true) {
|
|
1273
1273
|
const locale0 = locale || Locale.getLocaleName();
|
|
1274
1274
|
const day = this.getDate();
|
|
1275
|
-
const
|
|
1275
|
+
const monthName0 = Locale.gettext(this.getMonthName(), locale0);
|
|
1276
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
1276
1277
|
const nth = Locale.ordinal(day, locale0);
|
|
1277
1278
|
const dayOf = HDate.getDayOfTranslation(locale0);
|
|
1278
1279
|
const dateStr = `${nth}${dayOf} ${monthName}`;
|
|
@@ -3706,27 +3707,68 @@ class Zmanim {
|
|
|
3706
3707
|
return this.getShaahZmanisBasedZman(4);
|
|
3707
3708
|
}
|
|
3708
3709
|
/**
|
|
3709
|
-
*
|
|
3710
|
+
* Returns an array with alot (Date) and ms in hour (number)
|
|
3711
|
+
* @private
|
|
3712
|
+
* @return {any[]}
|
|
3713
|
+
*/
|
|
3714
|
+
getTemporalHour72() {
|
|
3715
|
+
const alot72 = this.sunriseOffset(-72, false, true);
|
|
3716
|
+
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3717
|
+
const temporalHour = (tzeit72 - alot72) / 12;
|
|
3718
|
+
return [alot72, temporalHour];
|
|
3719
|
+
}
|
|
3720
|
+
/**
|
|
3721
|
+
* Returns an array with alot (Date) and ms in hour (number)
|
|
3722
|
+
* @private
|
|
3723
|
+
* @return {any[]}
|
|
3724
|
+
*/
|
|
3725
|
+
getTemporalHour16Point1() {
|
|
3726
|
+
const alot16one = this.alotHaShachar();
|
|
3727
|
+
const tzeit16one = this.tzeit(16.1);
|
|
3728
|
+
const temporalHour = (tzeit16one - alot16one) / 12;
|
|
3729
|
+
return [alot16one, temporalHour];
|
|
3730
|
+
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
3733
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3734
|
+
* dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed
|
|
3735
|
+
* 72 minutes after sea-level sunset.
|
|
3710
3736
|
* @return {Date}
|
|
3711
3737
|
*/
|
|
3712
3738
|
sofZmanShmaMGA() {
|
|
3713
3739
|
// Magen Avraham
|
|
3714
|
-
const alot72 = this.
|
|
3715
|
-
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3716
|
-
const temporalHour = (tzeit72 - alot72) / 12; // ms in hour
|
|
3740
|
+
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
3717
3741
|
return new Date(alot72.getTime() + 3 * temporalHour);
|
|
3718
3742
|
}
|
|
3743
|
+
/**
|
|
3744
|
+
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
3745
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3746
|
+
* dawn to nightfall with both being 16.1° below the horizon.
|
|
3747
|
+
* @return {Date}
|
|
3748
|
+
*/
|
|
3749
|
+
sofZmanShmaMGA16Point1() {
|
|
3750
|
+
const [alot, temporalHour] = this.getTemporalHour16Point1();
|
|
3751
|
+
return new Date(alot.getTime() + 3 * temporalHour);
|
|
3752
|
+
}
|
|
3719
3753
|
/**
|
|
3720
3754
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
|
|
3721
3755
|
* @return {Date}
|
|
3722
3756
|
*/
|
|
3723
3757
|
sofZmanTfillaMGA() {
|
|
3724
3758
|
// Magen Avraham
|
|
3725
|
-
const alot72 = this.
|
|
3726
|
-
const tzeit72 = this.sunsetOffset(72, false, true);
|
|
3727
|
-
const temporalHour = (tzeit72 - alot72) / 12; // ms in hour
|
|
3759
|
+
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
3728
3760
|
return new Date(alot72.getTime() + 4 * temporalHour);
|
|
3729
3761
|
}
|
|
3762
|
+
/**
|
|
3763
|
+
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
3764
|
+
* Based on the opinion of the MGA that the day is calculated from
|
|
3765
|
+
* dawn to nightfall with both being 16.1° below the horizon.
|
|
3766
|
+
* @return {Date}
|
|
3767
|
+
*/
|
|
3768
|
+
sofZmanTfillaMGA16Point1() {
|
|
3769
|
+
const [alot, temporalHour] = this.getTemporalHour16Point1();
|
|
3770
|
+
return new Date(alot.getTime() + 4 * temporalHour);
|
|
3771
|
+
}
|
|
3730
3772
|
/**
|
|
3731
3773
|
* Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours
|
|
3732
3774
|
* @return {Date}
|
|
@@ -3879,6 +3921,54 @@ class Zmanim {
|
|
|
3879
3921
|
}
|
|
3880
3922
|
}
|
|
3881
3923
|
|
|
3924
|
+
const hour12cc = {
|
|
3925
|
+
US: 1,
|
|
3926
|
+
CA: 1,
|
|
3927
|
+
BR: 1,
|
|
3928
|
+
AU: 1,
|
|
3929
|
+
NZ: 1,
|
|
3930
|
+
DO: 1,
|
|
3931
|
+
PR: 1,
|
|
3932
|
+
GR: 1,
|
|
3933
|
+
IN: 1,
|
|
3934
|
+
KR: 1,
|
|
3935
|
+
NP: 1,
|
|
3936
|
+
ZA: 1
|
|
3937
|
+
};
|
|
3938
|
+
|
|
3939
|
+
/**
|
|
3940
|
+
* @private
|
|
3941
|
+
* @param {string} timeStr - original time like "20:30"
|
|
3942
|
+
* @param {string} suffix - "p" or "pm" or " P.M.". Add leading space if you want it
|
|
3943
|
+
* @param {CalOptions} options
|
|
3944
|
+
* @return {string}
|
|
3945
|
+
*/
|
|
3946
|
+
function reformatTimeStr(timeStr, suffix, options) {
|
|
3947
|
+
var _options$location;
|
|
3948
|
+
if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
3949
|
+
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');
|
|
3950
|
+
const hour12 = options === null || options === void 0 ? void 0 : options.hour12;
|
|
3951
|
+
if (typeof hour12 !== 'undefined' && !hour12) {
|
|
3952
|
+
return timeStr;
|
|
3953
|
+
}
|
|
3954
|
+
if (!hour12 && typeof hour12cc[cc] === 'undefined') {
|
|
3955
|
+
return timeStr;
|
|
3956
|
+
}
|
|
3957
|
+
const hm = timeStr.split(':');
|
|
3958
|
+
let hour = parseInt(hm[0], 10);
|
|
3959
|
+
if (hour < 12 && suffix) {
|
|
3960
|
+
suffix = suffix.replace('p', 'a').replace('P', 'A');
|
|
3961
|
+
if (hour === 0) {
|
|
3962
|
+
hour = 12;
|
|
3963
|
+
}
|
|
3964
|
+
} else if (hour > 12) {
|
|
3965
|
+
hour = hour % 12;
|
|
3966
|
+
} else if (hour === 0) {
|
|
3967
|
+
hour = '00';
|
|
3968
|
+
}
|
|
3969
|
+
return `${hour}:${hm[1]}${suffix}`;
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3882
3972
|
/* eslint-disable max-len */
|
|
3883
3973
|
const FRI$3 = 5;
|
|
3884
3974
|
const SAT$3 = 6;
|
|
@@ -3888,11 +3978,10 @@ const SAT$3 = 6;
|
|
|
3888
3978
|
* @param {Event} e
|
|
3889
3979
|
* @param {HDate} hd
|
|
3890
3980
|
* @param {number} dow
|
|
3891
|
-
* @param {Location} location
|
|
3892
3981
|
* @param {CalOptions} options
|
|
3893
3982
|
* @return {Event}
|
|
3894
3983
|
*/
|
|
3895
|
-
function makeCandleEvent(e, hd, dow,
|
|
3984
|
+
function makeCandleEvent(e, hd, dow, options) {
|
|
3896
3985
|
let havdalahTitle = false;
|
|
3897
3986
|
let useHavdalahOffset = dow === SAT$3;
|
|
3898
3987
|
let mask = e ? e.getFlags() : flags.LIGHT_CANDLES;
|
|
@@ -3912,15 +4001,16 @@ function makeCandleEvent(e, hd, dow, location, options) {
|
|
|
3912
4001
|
}
|
|
3913
4002
|
// if offset is 0 or undefined, we'll use tzeit time
|
|
3914
4003
|
const offset = useHavdalahOffset ? options.havdalahMins : options.candleLightingMins;
|
|
4004
|
+
const location = options.location;
|
|
3915
4005
|
const zmanim = new Zmanim(location, hd, options.useElevation);
|
|
3916
4006
|
const time = offset ? zmanim.sunsetOffset(offset, true) : zmanim.tzeit(options.havdalahDeg);
|
|
3917
4007
|
if (isNaN(time.getTime())) {
|
|
3918
4008
|
return null; // no sunset
|
|
3919
4009
|
}
|
|
3920
4010
|
if (havdalahTitle) {
|
|
3921
|
-
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e);
|
|
4011
|
+
return new HavdalahEvent(hd, mask, time, location, options.havdalahMins, e, options);
|
|
3922
4012
|
} else {
|
|
3923
|
-
return new CandleLightingEvent(hd, mask, time, location, e);
|
|
4013
|
+
return new CandleLightingEvent(hd, mask, time, location, e, options);
|
|
3924
4014
|
}
|
|
3925
4015
|
}
|
|
3926
4016
|
|
|
@@ -3933,13 +4023,18 @@ class TimedEvent extends Event {
|
|
|
3933
4023
|
* @param {Date} eventTime
|
|
3934
4024
|
* @param {Location} location
|
|
3935
4025
|
* @param {Event} linkedEvent
|
|
4026
|
+
* @param {CalOptions} options
|
|
3936
4027
|
*/
|
|
3937
|
-
constructor(date, desc, mask, eventTime, location, linkedEvent) {
|
|
4028
|
+
constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
|
|
3938
4029
|
super(date, desc, mask);
|
|
3939
4030
|
this.eventTime = Zmanim.roundTime(eventTime);
|
|
3940
4031
|
this.location = location;
|
|
3941
4032
|
const timeFormat = location.getTimeFormatter();
|
|
3942
4033
|
this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);
|
|
4034
|
+
const opts = Object.assign({
|
|
4035
|
+
location
|
|
4036
|
+
}, options);
|
|
4037
|
+
this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);
|
|
3943
4038
|
if (typeof linkedEvent !== 'undefined') {
|
|
3944
4039
|
this.linkedEvent = linkedEvent;
|
|
3945
4040
|
}
|
|
@@ -3949,7 +4044,7 @@ class TimedEvent extends Event {
|
|
|
3949
4044
|
* @return {string}
|
|
3950
4045
|
*/
|
|
3951
4046
|
render(locale) {
|
|
3952
|
-
return Locale.gettext(this.getDesc(), locale) + ': ' + this.
|
|
4047
|
+
return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;
|
|
3953
4048
|
}
|
|
3954
4049
|
/**
|
|
3955
4050
|
* Returns translation of "Candle lighting" without the time.
|
|
@@ -3986,9 +4081,10 @@ class HavdalahEvent extends TimedEvent {
|
|
|
3986
4081
|
* @param {Location} location
|
|
3987
4082
|
* @param {number} havdalahMins
|
|
3988
4083
|
* @param {Event} linkedEvent
|
|
4084
|
+
* @param {CalOptions} options
|
|
3989
4085
|
*/
|
|
3990
|
-
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent) {
|
|
3991
|
-
super(date, 'Havdalah', mask, eventTime, location, linkedEvent);
|
|
4086
|
+
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
|
|
4087
|
+
super(date, 'Havdalah', mask, eventTime, location, linkedEvent, options);
|
|
3992
4088
|
if (havdalahMins) {
|
|
3993
4089
|
this.havdalahMins = havdalahMins;
|
|
3994
4090
|
}
|
|
@@ -3998,7 +4094,7 @@ class HavdalahEvent extends TimedEvent {
|
|
|
3998
4094
|
* @return {string}
|
|
3999
4095
|
*/
|
|
4000
4096
|
render(locale) {
|
|
4001
|
-
return this.renderBrief(locale) + ': ' + this.
|
|
4097
|
+
return this.renderBrief(locale) + ': ' + this.fmtTime;
|
|
4002
4098
|
}
|
|
4003
4099
|
/**
|
|
4004
4100
|
* Returns translation of "Havdalah" without the time.
|
|
@@ -4027,9 +4123,10 @@ class CandleLightingEvent extends TimedEvent {
|
|
|
4027
4123
|
* @param {Date} eventTime
|
|
4028
4124
|
* @param {Location} location
|
|
4029
4125
|
* @param {Event} linkedEvent
|
|
4126
|
+
* @param {CalOptions} options
|
|
4030
4127
|
*/
|
|
4031
|
-
constructor(date, mask, eventTime, location, linkedEvent) {
|
|
4032
|
-
super(date, 'Candle lighting', mask, eventTime, location, linkedEvent);
|
|
4128
|
+
constructor(date, mask, eventTime, location, linkedEvent, options) {
|
|
4129
|
+
super(date, 'Candle lighting', mask, eventTime, location, linkedEvent, options);
|
|
4033
4130
|
}
|
|
4034
4131
|
/** @return {string} */
|
|
4035
4132
|
getEmoji() {
|
|
@@ -4057,14 +4154,14 @@ function makeFastStartEnd(ev, options) {
|
|
|
4057
4154
|
const zmanim = new Zmanim(location, dt, options.useElevation);
|
|
4058
4155
|
if (desc === 'Erev Tish\'a B\'Av') {
|
|
4059
4156
|
const sunset = zmanim.sunset();
|
|
4060
|
-
ev.startEvent = makeTimedEvent(hd, sunset, 'Fast begins', ev,
|
|
4157
|
+
ev.startEvent = makeTimedEvent(hd, sunset, 'Fast begins', ev, options);
|
|
4061
4158
|
} else if (desc.startsWith('Tish\'a B\'Av')) {
|
|
4062
|
-
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev,
|
|
4159
|
+
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev, options);
|
|
4063
4160
|
} else {
|
|
4064
4161
|
const dawn = zmanim.alotHaShachar();
|
|
4065
|
-
ev.startEvent = makeTimedEvent(hd, dawn, 'Fast begins', ev,
|
|
4162
|
+
ev.startEvent = makeTimedEvent(hd, dawn, 'Fast begins', ev, options);
|
|
4066
4163
|
if (dt.getDay() !== 5 && !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)) {
|
|
4067
|
-
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev,
|
|
4164
|
+
ev.endEvent = makeTimedEvent(hd, zmanim.tzeit(fastEndDeg), 'Fast ends', ev, options);
|
|
4068
4165
|
}
|
|
4069
4166
|
}
|
|
4070
4167
|
return ev;
|
|
@@ -4076,14 +4173,15 @@ function makeFastStartEnd(ev, options) {
|
|
|
4076
4173
|
* @param {Date} time
|
|
4077
4174
|
* @param {string} desc
|
|
4078
4175
|
* @param {Event} ev
|
|
4079
|
-
* @param {
|
|
4176
|
+
* @param {CalOptions} options
|
|
4080
4177
|
* @return {TimedEvent}
|
|
4081
4178
|
*/
|
|
4082
|
-
function makeTimedEvent(hd, time, desc, ev,
|
|
4179
|
+
function makeTimedEvent(hd, time, desc, ev, options) {
|
|
4083
4180
|
if (isNaN(time.getTime())) {
|
|
4084
4181
|
return null;
|
|
4085
4182
|
}
|
|
4086
|
-
|
|
4183
|
+
const location = options.location;
|
|
4184
|
+
return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
|
|
4087
4185
|
}
|
|
4088
4186
|
|
|
4089
4187
|
/**
|
|
@@ -4099,7 +4197,7 @@ function makeWeekdayChanukahCandleLighting(ev, hd, options) {
|
|
|
4099
4197
|
const zmanim = new Zmanim(location, hd.greg(), options.useElevation);
|
|
4100
4198
|
const candleLightingTime = zmanim.dusk();
|
|
4101
4199
|
// const candleLightingTime = zmanim.tzeit(4.6667);
|
|
4102
|
-
return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev,
|
|
4200
|
+
return makeTimedEvent(hd, candleLightingTime, ev.getDesc(), ev, options);
|
|
4103
4201
|
}
|
|
4104
4202
|
|
|
4105
4203
|
/* eslint-disable camelcase */
|
|
@@ -4187,6 +4285,34 @@ class Molad {
|
|
|
4187
4285
|
getChalakim() {
|
|
4188
4286
|
return this.chalakim;
|
|
4189
4287
|
}
|
|
4288
|
+
/**
|
|
4289
|
+
* @param {string} [locale] Optional locale name (defaults to active locale)
|
|
4290
|
+
* @param {CalOptions} options
|
|
4291
|
+
* @return {string}
|
|
4292
|
+
*/
|
|
4293
|
+
render(locale, options) {
|
|
4294
|
+
locale = locale || Locale.getLocaleName();
|
|
4295
|
+
if (typeof locale === 'string') {
|
|
4296
|
+
locale = locale.toLowerCase();
|
|
4297
|
+
}
|
|
4298
|
+
const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
|
|
4299
|
+
const monthName = Locale.gettext(this.getMonthName(), locale);
|
|
4300
|
+
const dayNames = isHebrewLocale ? heDayNames : shortDayNames;
|
|
4301
|
+
const dow = dayNames[this.getDow()];
|
|
4302
|
+
const minutes = this.getMinutes();
|
|
4303
|
+
const hour = this.getHour();
|
|
4304
|
+
const chalakim = this.getChalakim();
|
|
4305
|
+
const moladStr = Locale.gettext('Molad', locale);
|
|
4306
|
+
const minutesStr = Locale.lookupTranslation('min', locale) || 'minutes';
|
|
4307
|
+
const chalakimStr = Locale.gettext('chalakim', locale);
|
|
4308
|
+
if (isHebrewLocale) {
|
|
4309
|
+
const ampm = hour < 5 ? night : hour < 12 ? morning : hour < 17 ? afternoon : hour < 21 ? evening : night;
|
|
4310
|
+
return `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` + `בְּשָׁעָה ${hour} ${ampm}, ` + `ו-${minutes} ${minutesStr} ` + `ו-${chalakim} ${chalakimStr}`;
|
|
4311
|
+
}
|
|
4312
|
+
const fmtTime = reformatTimeStr(`${hour}:00`, 'pm', options);
|
|
4313
|
+
const month = monthName.replace(/'/g, '’');
|
|
4314
|
+
return `${moladStr} ${month}: ${dow}, ${minutes} ${minutesStr} and ${chalakim} ${chalakimStr} after ${fmtTime}`;
|
|
4315
|
+
}
|
|
4190
4316
|
}
|
|
4191
4317
|
|
|
4192
4318
|
/** Represents a Molad announcement on Shabbat Mevarchim */
|
|
@@ -4195,38 +4321,21 @@ class MoladEvent extends Event {
|
|
|
4195
4321
|
* @param {HDate} date Hebrew date event occurs
|
|
4196
4322
|
* @param {number} hyear molad year
|
|
4197
4323
|
* @param {number} hmonth molad month
|
|
4324
|
+
* @param {CalOptions} options
|
|
4198
4325
|
*/
|
|
4199
|
-
constructor(date, hyear, hmonth) {
|
|
4326
|
+
constructor(date, hyear, hmonth, options) {
|
|
4200
4327
|
const m = new Molad(hyear, hmonth);
|
|
4201
4328
|
const monthName = m.getMonthName();
|
|
4202
4329
|
super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);
|
|
4203
4330
|
this.molad = m;
|
|
4331
|
+
this.options = options;
|
|
4204
4332
|
}
|
|
4205
4333
|
/**
|
|
4206
4334
|
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
4207
4335
|
* @return {string}
|
|
4208
4336
|
*/
|
|
4209
4337
|
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`;
|
|
4338
|
+
return this.molad.render(locale, this.options);
|
|
4230
4339
|
}
|
|
4231
4340
|
}
|
|
4232
4341
|
|
|
@@ -5750,6 +5859,26 @@ class HolidayEvent extends Event {
|
|
|
5750
5859
|
return ['holiday', 'major'];
|
|
5751
5860
|
}
|
|
5752
5861
|
}
|
|
5862
|
+
/**
|
|
5863
|
+
* Returns (translated) description of this event
|
|
5864
|
+
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
5865
|
+
* @return {string}
|
|
5866
|
+
*/
|
|
5867
|
+
render(locale) {
|
|
5868
|
+
const str = super.render(locale);
|
|
5869
|
+
return str.replace(/'/g, '’');
|
|
5870
|
+
}
|
|
5871
|
+
/**
|
|
5872
|
+
* Returns a brief (translated) description of this event.
|
|
5873
|
+
* For most events, this is the same as render(). For some events, it procudes
|
|
5874
|
+
* a shorter text (e.g. without a time or added description).
|
|
5875
|
+
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
5876
|
+
* @return {string}
|
|
5877
|
+
*/
|
|
5878
|
+
renderBrief(locale) {
|
|
5879
|
+
const str = super.renderBrief(locale);
|
|
5880
|
+
return str.replace(/'/g, '’');
|
|
5881
|
+
}
|
|
5753
5882
|
}
|
|
5754
5883
|
const roshChodeshStr = 'Rosh Chodesh';
|
|
5755
5884
|
|
|
@@ -5770,7 +5899,9 @@ class RoshChodeshEvent extends HolidayEvent {
|
|
|
5770
5899
|
*/
|
|
5771
5900
|
render(locale) {
|
|
5772
5901
|
const monthName = this.getDesc().substring(roshChodeshStr.length + 1);
|
|
5773
|
-
|
|
5902
|
+
const monthName0 = Locale.gettext(monthName, locale);
|
|
5903
|
+
const monthName1 = monthName0.replace(/'/g, '’');
|
|
5904
|
+
return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;
|
|
5774
5905
|
}
|
|
5775
5906
|
/** @return {string} */
|
|
5776
5907
|
basename() {
|
|
@@ -5809,8 +5940,10 @@ class MevarchimChodeshEvent extends Event {
|
|
|
5809
5940
|
const hyear = date.getFullYear();
|
|
5810
5941
|
const hmonth = date.getMonth();
|
|
5811
5942
|
const monNext = hmonth == HDate.monthsInYear(hyear) ? NISAN$1 : hmonth + 1;
|
|
5812
|
-
const molad = new
|
|
5813
|
-
this.memo = molad.render('en'
|
|
5943
|
+
const molad = new Molad(hyear, monNext);
|
|
5944
|
+
this.memo = molad.render('en', {
|
|
5945
|
+
hour12: false
|
|
5946
|
+
});
|
|
5814
5947
|
}
|
|
5815
5948
|
/** @return {string} */
|
|
5816
5949
|
basename() {
|
|
@@ -5822,7 +5955,19 @@ class MevarchimChodeshEvent extends Event {
|
|
|
5822
5955
|
* @return {string}
|
|
5823
5956
|
*/
|
|
5824
5957
|
render(locale) {
|
|
5825
|
-
|
|
5958
|
+
const monthName0 = Locale.gettext(this.monthName, locale);
|
|
5959
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
5960
|
+
return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;
|
|
5961
|
+
}
|
|
5962
|
+
/**
|
|
5963
|
+
* Returns (translated) description of this event
|
|
5964
|
+
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
5965
|
+
* @return {string}
|
|
5966
|
+
*/
|
|
5967
|
+
renderBrief(locale) {
|
|
5968
|
+
const str = this.render(locale);
|
|
5969
|
+
const space = str.indexOf(' ');
|
|
5970
|
+
return str.substring(space + 1);
|
|
5826
5971
|
}
|
|
5827
5972
|
}
|
|
5828
5973
|
|
|
@@ -5874,7 +6019,9 @@ class YomKippurKatanEvent extends HolidayEvent {
|
|
|
5874
6019
|
* @return {string}
|
|
5875
6020
|
*/
|
|
5876
6021
|
render(locale) {
|
|
5877
|
-
|
|
6022
|
+
const monthName0 = Locale.gettext(this.nextMonthName, locale);
|
|
6023
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
6024
|
+
return Locale.gettext(ykk, locale) + ' ' + monthName;
|
|
5878
6025
|
}
|
|
5879
6026
|
/**
|
|
5880
6027
|
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
@@ -6164,7 +6311,7 @@ class DailyLearning {
|
|
|
6164
6311
|
}
|
|
6165
6312
|
|
|
6166
6313
|
// DO NOT EDIT THIS AUTO-GENERATED FILE!
|
|
6167
|
-
const version = '5.0.
|
|
6314
|
+
const version = '5.0.8';
|
|
6168
6315
|
|
|
6169
6316
|
const NONE$1 = 0;
|
|
6170
6317
|
const HALF = 1;
|
|
@@ -6215,7 +6362,7 @@ var poAshkenazi = {
|
|
|
6215
6362
|
"Shabbat": ["Shabbos"],
|
|
6216
6363
|
"Achrei Mot": ["Achrei Mos"],
|
|
6217
6364
|
"Bechukotai": ["Bechukosai"],
|
|
6218
|
-
"Beha'alotcha": ["Beha
|
|
6365
|
+
"Beha'alotcha": ["Beha’aloscha"],
|
|
6219
6366
|
"Bereshit": ["Bereshis"],
|
|
6220
6367
|
"Chukat": ["Chukas"],
|
|
6221
6368
|
"Erev Shavuot": ["Erev Shavuos"],
|
|
@@ -6242,14 +6389,14 @@ var poAshkenazi = {
|
|
|
6242
6389
|
"Sukkot": ["Sukkos"],
|
|
6243
6390
|
"Sukkot I": ["Sukkos I"],
|
|
6244
6391
|
"Sukkot II": ["Sukkos II"],
|
|
6245
|
-
"Sukkot II (CH''M)": ["Sukkos II (CH
|
|
6246
|
-
"Sukkot III (CH''M)": ["Sukkos III (CH
|
|
6247
|
-
"Sukkot IV (CH''M)": ["Sukkos IV (CH
|
|
6248
|
-
"Sukkot V (CH''M)": ["Sukkos V (CH
|
|
6249
|
-
"Sukkot VI (CH''M)": ["Sukkos VI (CH
|
|
6392
|
+
"Sukkot II (CH''M)": ["Sukkos II (CH’’M)"],
|
|
6393
|
+
"Sukkot III (CH''M)": ["Sukkos III (CH’’M)"],
|
|
6394
|
+
"Sukkot IV (CH''M)": ["Sukkos IV (CH’’M)"],
|
|
6395
|
+
"Sukkot V (CH''M)": ["Sukkos V (CH’’M)"],
|
|
6396
|
+
"Sukkot VI (CH''M)": ["Sukkos VI (CH’’M)"],
|
|
6250
6397
|
"Sukkot VII (Hoshana Raba)": ["Sukkos VII (Hoshana Raba)"],
|
|
6251
|
-
"Ta'anit Bechorot": ["Ta
|
|
6252
|
-
"Ta'anit Esther": ["Ta
|
|
6398
|
+
"Ta'anit Bechorot": ["Ta’anis Bechoros"],
|
|
6399
|
+
"Ta'anit Esther": ["Ta’anis Esther"],
|
|
6253
6400
|
"Toldot": ["Toldos"],
|
|
6254
6401
|
"Vaetchanan": ["Vaeschanan"],
|
|
6255
6402
|
"Yitro": ["Yisro"],
|
|
@@ -6259,7 +6406,7 @@ var poAshkenazi = {
|
|
|
6259
6406
|
"Shabbat Mevarchim Chodesh": ["Shabbos Mevorchim Chodesh"],
|
|
6260
6407
|
"Shabbat Shirah": ["Shabbos Shirah"],
|
|
6261
6408
|
"Tevet": ["Teves"],
|
|
6262
|
-
"Asara B'Tevet": ["Asara B
|
|
6409
|
+
"Asara B'Tevet": ["Asara B’Teves"],
|
|
6263
6410
|
"Alot HaShachar": ["Alos HaShachar"],
|
|
6264
6411
|
"Kriat Shema, sof zeman": ["Krias Shema, sof zman"],
|
|
6265
6412
|
"Tefilah, sof zeman": ["Tefilah, sof zman"],
|
|
@@ -7118,20 +7265,6 @@ function getMaskFromOptions(options) {
|
|
|
7118
7265
|
}
|
|
7119
7266
|
const MASK_LIGHT_CANDLES = LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES | YOM_TOV_ENDS;
|
|
7120
7267
|
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
7268
|
|
|
7136
7269
|
/**
|
|
7137
7270
|
* @private
|
|
@@ -7386,10 +7519,10 @@ class HebrewCalendar {
|
|
|
7386
7519
|
const hmonth = hd.getMonth();
|
|
7387
7520
|
if (options.molad && dow == SAT && hmonth != ELUL && hd.getDate() >= 23 && hd.getDate() <= 29) {
|
|
7388
7521
|
const monNext = hmonth == HDate.monthsInYear(hyear) ? NISAN : hmonth + 1;
|
|
7389
|
-
evts.push(new MoladEvent(hd, hyear, monNext));
|
|
7522
|
+
evts.push(new MoladEvent(hd, hyear, monNext, options));
|
|
7390
7523
|
}
|
|
7391
7524
|
if (!candlesEv && options.candlelighting && (dow == FRI || dow == SAT)) {
|
|
7392
|
-
candlesEv = makeCandleEvent(undefined, hd, dow,
|
|
7525
|
+
candlesEv = makeCandleEvent(undefined, hd, dow, options);
|
|
7393
7526
|
if (dow === FRI && candlesEv && sedra) {
|
|
7394
7527
|
candlesEv.memo = sedra.getString(abs);
|
|
7395
7528
|
}
|
|
@@ -7556,28 +7689,7 @@ class HebrewCalendar {
|
|
|
7556
7689
|
* @return {string}
|
|
7557
7690
|
*/
|
|
7558
7691
|
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}`;
|
|
7692
|
+
return reformatTimeStr(timeStr, suffix, options);
|
|
7581
7693
|
}
|
|
7582
7694
|
|
|
7583
7695
|
/** @return {string} */
|
|
@@ -7676,7 +7788,7 @@ function appendHolidayAndRelated(events, ev, options, candlesEv, dow) {
|
|
|
7676
7788
|
if (eFlags & options.mask || !eFlags && !options.userMask) {
|
|
7677
7789
|
if (options.candlelighting && eFlags & MASK_LIGHT_CANDLES) {
|
|
7678
7790
|
const hd = ev.getDate();
|
|
7679
|
-
candlesEv = makeCandleEvent(ev, hd, dow,
|
|
7791
|
+
candlesEv = makeCandleEvent(ev, hd, dow, options);
|
|
7680
7792
|
if (eFlags & CHANUKAH_CANDLES && candlesEv && !options.noHolidays) {
|
|
7681
7793
|
const chanukahEv = dow === FRI || dow === SAT ? candlesEv : makeWeekdayChanukahCandleLighting(ev, hd, options);
|
|
7682
7794
|
const attrs = {
|