@hebcal/core 6.0.6 → 6.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/README.md +42 -27
- package/dist/bundle.js +13 -8
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +3 -3
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +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/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +1 -1
- package/dist/esm/candles.js +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-x-NoNikud.po.d.ts +2 -0
- package/dist/esm/he-x-NoNikud.po.js +2 -2
- package/dist/esm/he-x-NoNikud.po.js.map +1 -1
- package/dist/esm/he.po.d.ts +1 -0
- package/dist/esm/he.po.js +2 -2
- package/dist/esm/he.po.js.map +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/isAssurBemlacha.js +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +2 -2
- package/dist/esm/location.js.map +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +1 -1
- package/dist/esm/parshaYear.d.ts +2 -2
- package/dist/esm/parshaYear.js +1 -1
- package/dist/esm/parshaYear.js.map +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 +1 -1
- package/dist/esm/sedra.d.ts +5 -1
- package/dist/esm/sedra.js +9 -3
- package/dist/esm/sedra.js.map +1 -1
- package/dist/esm/staticHolidays.js +1 -2
- package/dist/esm/staticHolidays.js.map +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/he-x-NoNikud.po.d.ts +2 -0
- package/dist/he.po.d.ts +1 -0
- package/dist/parshaYear.d.ts +2 -2
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/po2json.d.ts +1 -0
- package/dist/po2json.js +41 -0
- package/dist/sedra.d.ts +5 -1
- package/dist/size-demo/dist/getHoliday.d.ts +1944 -0
- package/dist/size-demo/dist/getHoliday.js +3712 -0
- package/dist/size-demo/dist/parshiyot.js +10662 -0
- package/dist/size-demo/dist/sedra.d.ts +1411 -0
- package/dist/size-demo/dist/sedra.js +2359 -0
- package/dist/size-demo/dist/tachanun.d.ts +1015 -0
- package/dist/size-demo/dist/tachanun.js +1755 -0
- package/dist/size-demo/getHoliday.d.ts +1 -0
- package/dist/size-demo/getHoliday.js +3 -0
- package/dist/size-demo/parshiyot.d.ts +1 -0
- package/dist/size-demo/parshiyot.js +11 -0
- package/dist/size-demo/rollup.config.d.ts +3 -0
- package/dist/size-demo/rollup.config.js +47 -0
- package/dist/size-demo/sedra.d.ts +1 -0
- package/dist/size-demo/sedra.js +3 -0
- package/dist/size-demo/tachanun.d.ts +1 -0
- package/dist/size-demo/tachanun.js +3 -0
- package/dist/src/CalOptions.d.ts +168 -0
- package/dist/src/CalOptions.js +1 -0
- package/dist/src/DailyLearning.d.ts +32 -0
- package/dist/src/DailyLearning.js +55 -0
- package/dist/src/HebrewDateEvent.d.ts +37 -0
- package/dist/src/HebrewDateEvent.js +72 -0
- package/dist/src/HolidayEvent.d.ts +83 -0
- package/dist/src/HolidayEvent.js +186 -0
- package/dist/src/MevarchimChodeshEvent.d.ts +26 -0
- package/dist/src/MevarchimChodeshEvent.js +50 -0
- package/dist/src/ParshaEvent.d.ts +19 -0
- package/dist/src/ParshaEvent.js +43 -0
- package/dist/src/TimedEvent.d.ts +47 -0
- package/dist/src/TimedEvent.js +92 -0
- package/dist/src/YomKippurKatanEvent.d.ts +23 -0
- package/dist/src/YomKippurKatanEvent.js +38 -0
- package/dist/src/ashkenazi.po.d.ts +70 -0
- package/dist/src/ashkenazi.po.js +1 -0
- package/dist/src/calendar.d.ts +111 -0
- package/dist/src/calendar.js +660 -0
- package/dist/src/candles.d.ts +44 -0
- package/dist/src/candles.js +163 -0
- package/dist/src/event.d.ts +188 -0
- package/dist/src/event.js +233 -0
- package/dist/src/getStartAndEnd.d.ts +6 -0
- package/dist/src/getStartAndEnd.js +97 -0
- package/dist/src/hallel.d.ts +6 -0
- package/dist/src/hallel.js +47 -0
- package/dist/src/he-x-NoNikud.po.d.ts +15 -0
- package/dist/src/he-x-NoNikud.po.js +1 -0
- package/dist/src/he.po.d.ts +195 -0
- package/dist/src/he.po.js +1 -0
- package/dist/src/hebcal.d.ts +260 -0
- package/dist/src/hebcal.js +332 -0
- package/dist/src/holidays.d.ts +22 -0
- package/dist/src/holidays.js +288 -0
- package/dist/src/index.d.ts +26 -0
- package/dist/src/index.js +24 -0
- package/dist/src/isAssurBemlacha.d.ts +9 -0
- package/dist/src/isAssurBemlacha.js +62 -0
- package/dist/src/locale.d.ts +2 -0
- package/dist/src/locale.js +11 -0
- package/dist/src/location.d.ts +73 -0
- package/dist/src/location.js +306 -0
- package/dist/src/modern.d.ts +18 -0
- package/dist/src/modern.js +59 -0
- package/dist/src/molad.d.ts +62 -0
- package/dist/src/molad.js +169 -0
- package/dist/src/omer.d.ts +53 -0
- package/dist/src/omer.js +302 -0
- package/dist/src/parshaName.d.ts +2 -0
- package/dist/src/parshaName.js +13 -0
- package/dist/src/parshaYear.d.ts +9 -0
- package/dist/src/parshaYear.js +24 -0
- package/dist/src/pkgVersion.d.ts +2 -0
- package/dist/src/pkgVersion.js +2 -0
- package/dist/src/reformatTimeStr.d.ts +8 -0
- package/dist/src/reformatTimeStr.js +48 -0
- package/dist/src/sedra.d.ts +95 -0
- package/dist/src/sedra.js +477 -0
- package/dist/src/staticHolidays.d.ts +176 -0
- package/dist/src/staticHolidays.js +614 -0
- package/dist/src/tachanun.d.ts +29 -0
- package/dist/src/tachanun.js +120 -0
- package/dist/src/zmanim.d.ts +347 -0
- package/dist/src/zmanim.js +579 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +9 -0
- package/package.json +11 -8
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Locale, isoDateString } from '@hebcal/hdate';
|
|
2
|
+
import { Event, flags } from './event';
|
|
3
|
+
import { holidayDesc as hdesc } from './staticHolidays';
|
|
4
|
+
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
5
|
+
/** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
|
|
6
|
+
export class HolidayEvent extends Event {
|
|
7
|
+
basename() {
|
|
8
|
+
return this.getDesc()
|
|
9
|
+
.replace(/ \d{4}$/, '')
|
|
10
|
+
.replace(/ \(CH''M\)$/, '')
|
|
11
|
+
.replace(/ \(observed\)$/, '')
|
|
12
|
+
.replace(/ \(Hoshana Raba\)$/, '')
|
|
13
|
+
.replace(/ [IV]+$/, '')
|
|
14
|
+
.replace(/: \d Candles?$/, '')
|
|
15
|
+
.replace(/: 8th Day$/, '')
|
|
16
|
+
.replace(/^Erev /, '');
|
|
17
|
+
}
|
|
18
|
+
url() {
|
|
19
|
+
const year = this.greg().getFullYear();
|
|
20
|
+
if (year < 100 || year > 2999) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
const url = 'https://www.hebcal.com/holidays/' +
|
|
24
|
+
this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
|
|
25
|
+
'-' +
|
|
26
|
+
this.urlDateSuffix();
|
|
27
|
+
return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
|
|
28
|
+
}
|
|
29
|
+
urlDateSuffix() {
|
|
30
|
+
const year = this.greg().getFullYear();
|
|
31
|
+
return String(year);
|
|
32
|
+
}
|
|
33
|
+
getEmoji() {
|
|
34
|
+
if (this.emoji) {
|
|
35
|
+
return this.emoji;
|
|
36
|
+
}
|
|
37
|
+
else if (this.getFlags() & flags.SPECIAL_SHABBAT) {
|
|
38
|
+
return '🕍';
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return '✡️';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
getCategories() {
|
|
45
|
+
if (this.cholHaMoedDay) {
|
|
46
|
+
return ['holiday', 'major', 'cholhamoed'];
|
|
47
|
+
}
|
|
48
|
+
const cats = super.getCategories();
|
|
49
|
+
if (cats[0] !== 'unknown') {
|
|
50
|
+
return cats;
|
|
51
|
+
}
|
|
52
|
+
// Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.
|
|
53
|
+
const desc = this.getDesc();
|
|
54
|
+
switch (desc) {
|
|
55
|
+
case hdesc.LAG_BAOMER:
|
|
56
|
+
case hdesc.LEIL_SELICHOT:
|
|
57
|
+
case hdesc.PESACH_SHENI:
|
|
58
|
+
case hdesc.EREV_PURIM:
|
|
59
|
+
case hdesc.PURIM_KATAN:
|
|
60
|
+
case hdesc.SHUSHAN_PURIM:
|
|
61
|
+
case hdesc.TU_BAV:
|
|
62
|
+
case hdesc.TU_BISHVAT:
|
|
63
|
+
case hdesc.ROSH_HASHANA_LABEHEMOT:
|
|
64
|
+
return ['holiday', 'minor'];
|
|
65
|
+
}
|
|
66
|
+
return ['holiday', 'major'];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Returns (translated) description of this event
|
|
70
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
71
|
+
*/
|
|
72
|
+
render(locale) {
|
|
73
|
+
const str = super.render(locale);
|
|
74
|
+
return str.replace(/'/g, '’');
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns a brief (translated) description of this event.
|
|
78
|
+
* For most events, this is the same as render(). For some events, it procudes
|
|
79
|
+
* a shorter text (e.g. without a time or added description).
|
|
80
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
81
|
+
*/
|
|
82
|
+
renderBrief(locale) {
|
|
83
|
+
const str = super.renderBrief(locale);
|
|
84
|
+
return str.replace(/'/g, '’');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Because Asara B'Tevet often occurs twice in the same Gregorian year,
|
|
89
|
+
* we subclass HolidayEvent to generate the correct URL.
|
|
90
|
+
*/
|
|
91
|
+
export class AsaraBTevetEvent extends HolidayEvent {
|
|
92
|
+
urlDateSuffix() {
|
|
93
|
+
const isoDate = isoDateString(this.greg());
|
|
94
|
+
return isoDate.replace(/-/g, '');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const chanukahEmoji = '🕎';
|
|
98
|
+
const KEYCAP_DIGITS = [
|
|
99
|
+
'0️⃣',
|
|
100
|
+
'1️⃣',
|
|
101
|
+
'2️⃣',
|
|
102
|
+
'3️⃣',
|
|
103
|
+
'4️⃣',
|
|
104
|
+
'5️⃣',
|
|
105
|
+
'6️⃣',
|
|
106
|
+
'7️⃣',
|
|
107
|
+
'8️⃣',
|
|
108
|
+
'9️⃣',
|
|
109
|
+
];
|
|
110
|
+
/**
|
|
111
|
+
* Because Chanukah sometimes starts in December and ends in January,
|
|
112
|
+
* we subclass HolidayEvent to generate the correct URL.
|
|
113
|
+
*/
|
|
114
|
+
export class ChanukahEvent extends HolidayEvent {
|
|
115
|
+
/**
|
|
116
|
+
* @param chanukahDay should be undefined for 1st night of Chanukah
|
|
117
|
+
*/
|
|
118
|
+
constructor(date, desc, mask, chanukahDay) {
|
|
119
|
+
super(date, desc, mask);
|
|
120
|
+
this.chanukahDay = chanukahDay;
|
|
121
|
+
this.emoji = chanukahEmoji;
|
|
122
|
+
if (chanukahDay !== 8) {
|
|
123
|
+
const candles = chanukahDay ? chanukahDay + 1 : 1;
|
|
124
|
+
this.emoji += KEYCAP_DIGITS[candles];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
urlDateSuffix() {
|
|
128
|
+
const dt = this.greg();
|
|
129
|
+
let year = dt.getFullYear();
|
|
130
|
+
if (dt.getMonth() === 0) {
|
|
131
|
+
year--;
|
|
132
|
+
}
|
|
133
|
+
return String(year);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/** Represents Rosh Hashana, the Jewish New Year */
|
|
137
|
+
export class RoshHashanaEvent extends HolidayEvent {
|
|
138
|
+
/**
|
|
139
|
+
* @private
|
|
140
|
+
* @param date Hebrew date event occurs
|
|
141
|
+
* @param hyear Hebrew year
|
|
142
|
+
* @param mask optional holiday flags
|
|
143
|
+
*/
|
|
144
|
+
constructor(date, hyear, mask) {
|
|
145
|
+
super(date, `Rosh Hashana ${hyear}`, mask);
|
|
146
|
+
this.hyear = hyear;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Returns (translated) description of this event
|
|
150
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
151
|
+
*/
|
|
152
|
+
render(locale) {
|
|
153
|
+
return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;
|
|
154
|
+
}
|
|
155
|
+
getEmoji() {
|
|
156
|
+
return '🍏🍯';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
const roshChodeshStr = 'Rosh Chodesh';
|
|
160
|
+
/** Represents Rosh Chodesh, the beginning of a new month */
|
|
161
|
+
export class RoshChodeshEvent extends HolidayEvent {
|
|
162
|
+
/**
|
|
163
|
+
* Constructs Rosh Chodesh event
|
|
164
|
+
* @param date Hebrew date event occurs
|
|
165
|
+
* @param monthName Hebrew month name (not translated)
|
|
166
|
+
*/
|
|
167
|
+
constructor(date, monthName) {
|
|
168
|
+
super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Returns (translated) description of this event
|
|
172
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
173
|
+
*/
|
|
174
|
+
render(locale) {
|
|
175
|
+
const monthName = this.getDesc().substring(roshChodeshStr.length + 1);
|
|
176
|
+
const monthName0 = Locale.gettext(monthName, locale);
|
|
177
|
+
const monthName1 = monthName0.replace(/'/g, '’');
|
|
178
|
+
return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;
|
|
179
|
+
}
|
|
180
|
+
basename() {
|
|
181
|
+
return this.getDesc();
|
|
182
|
+
}
|
|
183
|
+
getEmoji() {
|
|
184
|
+
return this.emoji || '🌒';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HDate } from '@hebcal/hdate';
|
|
2
|
+
import { Event } from './event';
|
|
3
|
+
import './locale';
|
|
4
|
+
/** Represents Mevarchim haChodesh, the announcement of the new month */
|
|
5
|
+
export declare class MevarchimChodeshEvent extends Event {
|
|
6
|
+
readonly monthName: string;
|
|
7
|
+
/**
|
|
8
|
+
* Constructs Mevarchim haChodesh event
|
|
9
|
+
* @param date Hebrew date event occurs
|
|
10
|
+
* @param monthName Hebrew month name (not translated)
|
|
11
|
+
* @param [memo]
|
|
12
|
+
* @param locale Optional locale name
|
|
13
|
+
*/
|
|
14
|
+
constructor(date: HDate, monthName: string, memo: string, locale?: string);
|
|
15
|
+
basename(): string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns (translated) description of this event
|
|
18
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
19
|
+
*/
|
|
20
|
+
render(locale?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns (translated) description of this event
|
|
23
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
24
|
+
*/
|
|
25
|
+
renderBrief(locale?: string): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { HDate, Locale, months } from '@hebcal/hdate';
|
|
2
|
+
import { Event, flags } from './event';
|
|
3
|
+
import { Molad } from './molad';
|
|
4
|
+
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
5
|
+
const mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';
|
|
6
|
+
/** Represents Mevarchim haChodesh, the announcement of the new month */
|
|
7
|
+
export class MevarchimChodeshEvent extends Event {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs Mevarchim haChodesh event
|
|
10
|
+
* @param date Hebrew date event occurs
|
|
11
|
+
* @param monthName Hebrew month name (not translated)
|
|
12
|
+
* @param [memo]
|
|
13
|
+
* @param locale Optional locale name
|
|
14
|
+
*/
|
|
15
|
+
constructor(date, monthName, memo, locale) {
|
|
16
|
+
super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
|
|
17
|
+
this.monthName = Locale.gettext(monthName, locale);
|
|
18
|
+
if (memo) {
|
|
19
|
+
this.memo = memo;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const hyear = date.getFullYear();
|
|
23
|
+
const hmonth = date.getMonth();
|
|
24
|
+
const monNext = hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;
|
|
25
|
+
const molad = new Molad(hyear, monNext);
|
|
26
|
+
this.memo = molad.render('en', { hour12: false });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
basename() {
|
|
30
|
+
return this.getDesc();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns (translated) description of this event
|
|
34
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
35
|
+
*/
|
|
36
|
+
render(locale) {
|
|
37
|
+
const monthName0 = Locale.gettext(this.monthName, locale);
|
|
38
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
39
|
+
return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns (translated) description of this event
|
|
43
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
44
|
+
*/
|
|
45
|
+
renderBrief(locale) {
|
|
46
|
+
const str = this.render(locale);
|
|
47
|
+
const space = str.indexOf(' ');
|
|
48
|
+
return str.substring(space + 1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Event } from './event';
|
|
2
|
+
import { SedraResult } from './sedra';
|
|
3
|
+
import './locale';
|
|
4
|
+
/**
|
|
5
|
+
* Represents one of 54 weekly Torah portions, always on a Saturday
|
|
6
|
+
*/
|
|
7
|
+
export declare class ParshaEvent extends Event {
|
|
8
|
+
readonly p: SedraResult;
|
|
9
|
+
constructor(parsha: SedraResult);
|
|
10
|
+
/**
|
|
11
|
+
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.
|
|
12
|
+
*/
|
|
13
|
+
render(locale?: string): string;
|
|
14
|
+
basename(): string;
|
|
15
|
+
url(): string | undefined;
|
|
16
|
+
urlDateSuffix(): string;
|
|
17
|
+
/** convenience function for compatibility with previous implementation */
|
|
18
|
+
get parsha(): string[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Event, flags } from './event';
|
|
2
|
+
import { isoDateString } from '@hebcal/hdate';
|
|
3
|
+
import { renderParshaName } from './parshaName';
|
|
4
|
+
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
5
|
+
/**
|
|
6
|
+
* Represents one of 54 weekly Torah portions, always on a Saturday
|
|
7
|
+
*/
|
|
8
|
+
export class ParshaEvent extends Event {
|
|
9
|
+
constructor(parsha) {
|
|
10
|
+
const desc = 'Parashat ' + parsha.parsha.join('-');
|
|
11
|
+
super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);
|
|
12
|
+
this.p = parsha;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.
|
|
16
|
+
*/
|
|
17
|
+
render(locale) {
|
|
18
|
+
return renderParshaName(this.p.parsha, locale);
|
|
19
|
+
}
|
|
20
|
+
basename() {
|
|
21
|
+
return this.p.parsha.join('-');
|
|
22
|
+
}
|
|
23
|
+
url() {
|
|
24
|
+
const year = this.greg().getFullYear();
|
|
25
|
+
if (year < 100 || year > 2999) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const dt = this.urlDateSuffix();
|
|
29
|
+
const url = 'https://www.hebcal.com/sedrot/' +
|
|
30
|
+
this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
|
|
31
|
+
'-' +
|
|
32
|
+
dt;
|
|
33
|
+
return this.p.il ? url + '?i=on' : url;
|
|
34
|
+
}
|
|
35
|
+
urlDateSuffix() {
|
|
36
|
+
const isoDate = isoDateString(this.greg());
|
|
37
|
+
return isoDate.replace(/-/g, '');
|
|
38
|
+
}
|
|
39
|
+
/** convenience function for compatibility with previous implementation */
|
|
40
|
+
get parsha() {
|
|
41
|
+
return this.p.parsha;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HDate } from '@hebcal/hdate';
|
|
2
|
+
import { CalOptions } from './CalOptions';
|
|
3
|
+
import { Location } from './location';
|
|
4
|
+
import { Event } from './event';
|
|
5
|
+
import './locale';
|
|
6
|
+
/** An event that has an `eventTime` and `eventTimeStr` */
|
|
7
|
+
export declare class TimedEvent extends Event {
|
|
8
|
+
readonly eventTime: Date;
|
|
9
|
+
readonly location: Location;
|
|
10
|
+
readonly eventTimeStr: string;
|
|
11
|
+
readonly fmtTime: string;
|
|
12
|
+
readonly linkedEvent?: Event;
|
|
13
|
+
/**
|
|
14
|
+
* @param desc Description (not translated)
|
|
15
|
+
*/
|
|
16
|
+
constructor(date: HDate, desc: string, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
|
|
17
|
+
/**
|
|
18
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
19
|
+
*/
|
|
20
|
+
render(locale?: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns translation of "Candle lighting" without the time.
|
|
23
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
24
|
+
*/
|
|
25
|
+
renderBrief(locale?: string): string;
|
|
26
|
+
getCategories(): string[];
|
|
27
|
+
}
|
|
28
|
+
/** Candle lighting before Shabbat or holiday */
|
|
29
|
+
export declare class CandleLightingEvent extends TimedEvent {
|
|
30
|
+
constructor(date: HDate, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
|
|
31
|
+
getEmoji(): string;
|
|
32
|
+
}
|
|
33
|
+
/** Havdalah after Shabbat or holiday */
|
|
34
|
+
export declare class HavdalahEvent extends TimedEvent {
|
|
35
|
+
private readonly havdalahMins?;
|
|
36
|
+
constructor(date: HDate, mask: number, eventTime: Date, location: Location, havdalahMins?: number, linkedEvent?: Event, options?: CalOptions);
|
|
37
|
+
/**
|
|
38
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
39
|
+
*/
|
|
40
|
+
render(locale?: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Returns translation of "Havdalah" without the time.
|
|
43
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
44
|
+
*/
|
|
45
|
+
renderBrief(locale?: string): string;
|
|
46
|
+
getEmoji(): string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Locale } from '@hebcal/hdate';
|
|
2
|
+
import { Event } from './event';
|
|
3
|
+
import { reformatTimeStr } from './reformatTimeStr';
|
|
4
|
+
import { Zmanim } from './zmanim';
|
|
5
|
+
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
6
|
+
/** An event that has an `eventTime` and `eventTimeStr` */
|
|
7
|
+
export class TimedEvent extends Event {
|
|
8
|
+
/**
|
|
9
|
+
* @param desc Description (not translated)
|
|
10
|
+
*/
|
|
11
|
+
constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
|
|
12
|
+
super(date, desc, mask);
|
|
13
|
+
this.eventTime = Zmanim.roundTime(eventTime);
|
|
14
|
+
this.location = location;
|
|
15
|
+
const timeFormat = location.getTimeFormatter();
|
|
16
|
+
this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);
|
|
17
|
+
const opts = Object.assign(Object.assign({}, options), { location });
|
|
18
|
+
this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);
|
|
19
|
+
if (typeof linkedEvent !== 'undefined') {
|
|
20
|
+
this.linkedEvent = linkedEvent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
25
|
+
*/
|
|
26
|
+
render(locale) {
|
|
27
|
+
return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns translation of "Candle lighting" without the time.
|
|
31
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
32
|
+
*/
|
|
33
|
+
renderBrief(locale) {
|
|
34
|
+
return Locale.gettext(this.getDesc(), locale);
|
|
35
|
+
}
|
|
36
|
+
getCategories() {
|
|
37
|
+
const desc = this.getDesc();
|
|
38
|
+
switch (desc) {
|
|
39
|
+
// LIGHT_CANDLES or LIGHT_CANDLES_TZEIS
|
|
40
|
+
case 'Candle lighting':
|
|
41
|
+
return ['candles'];
|
|
42
|
+
// YOM_TOV_ENDS
|
|
43
|
+
case 'Havdalah':
|
|
44
|
+
return ['havdalah'];
|
|
45
|
+
// flags.MINOR_FAST or flags.MAJOR_FAST
|
|
46
|
+
case 'Fast begins':
|
|
47
|
+
case 'Fast ends':
|
|
48
|
+
return ['zmanim', 'fast'];
|
|
49
|
+
}
|
|
50
|
+
/* NOTREACHED */
|
|
51
|
+
return ['unknown'];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** Candle lighting before Shabbat or holiday */
|
|
55
|
+
export class CandleLightingEvent extends TimedEvent {
|
|
56
|
+
constructor(date, mask, eventTime, location, linkedEvent, options) {
|
|
57
|
+
super(date, 'Candle lighting', mask, eventTime, location, linkedEvent, options);
|
|
58
|
+
}
|
|
59
|
+
getEmoji() {
|
|
60
|
+
return '🕯️';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Havdalah after Shabbat or holiday */
|
|
64
|
+
export class HavdalahEvent extends TimedEvent {
|
|
65
|
+
constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
|
|
66
|
+
super(date, 'Havdalah', mask, eventTime, location, linkedEvent, options);
|
|
67
|
+
if (havdalahMins) {
|
|
68
|
+
this.havdalahMins = havdalahMins;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
73
|
+
*/
|
|
74
|
+
render(locale) {
|
|
75
|
+
return this.renderBrief(locale) + ': ' + this.fmtTime;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns translation of "Havdalah" without the time.
|
|
79
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
80
|
+
*/
|
|
81
|
+
renderBrief(locale) {
|
|
82
|
+
let str = Locale.gettext(this.getDesc(), locale);
|
|
83
|
+
if (this.havdalahMins) {
|
|
84
|
+
const min = Locale.gettext('min', locale);
|
|
85
|
+
str += ` (${this.havdalahMins} ${min})`;
|
|
86
|
+
}
|
|
87
|
+
return str;
|
|
88
|
+
}
|
|
89
|
+
getEmoji() {
|
|
90
|
+
return '✨';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HDate } from '@hebcal/hdate';
|
|
2
|
+
import { HolidayEvent } from './HolidayEvent';
|
|
3
|
+
import './locale';
|
|
4
|
+
/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
5
|
+
export declare class YomKippurKatanEvent extends HolidayEvent {
|
|
6
|
+
private readonly nextMonthName;
|
|
7
|
+
/**
|
|
8
|
+
* @private
|
|
9
|
+
* @param date Hebrew date event occurs
|
|
10
|
+
* @param nextMonthName name of the upcoming month
|
|
11
|
+
*/
|
|
12
|
+
constructor(date: HDate, nextMonthName: string);
|
|
13
|
+
basename(): string;
|
|
14
|
+
/**
|
|
15
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
16
|
+
*/
|
|
17
|
+
render(locale?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
20
|
+
*/
|
|
21
|
+
renderBrief(locale?: string): string;
|
|
22
|
+
url(): string | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Locale } from '@hebcal/hdate';
|
|
2
|
+
import { flags } from './event';
|
|
3
|
+
import { HolidayEvent } from './HolidayEvent';
|
|
4
|
+
import './locale'; // Adds Hebrew and Ashkenazic translations
|
|
5
|
+
const ykk = 'Yom Kippur Katan';
|
|
6
|
+
/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */
|
|
7
|
+
export class YomKippurKatanEvent extends HolidayEvent {
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* @param date Hebrew date event occurs
|
|
11
|
+
* @param nextMonthName name of the upcoming month
|
|
12
|
+
*/
|
|
13
|
+
constructor(date, nextMonthName) {
|
|
14
|
+
super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
|
|
15
|
+
this.nextMonthName = nextMonthName;
|
|
16
|
+
this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
|
|
17
|
+
}
|
|
18
|
+
basename() {
|
|
19
|
+
return this.getDesc();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
23
|
+
*/
|
|
24
|
+
render(locale) {
|
|
25
|
+
const monthName0 = Locale.gettext(this.nextMonthName, locale);
|
|
26
|
+
const monthName = monthName0.replace(/'/g, '’');
|
|
27
|
+
return Locale.gettext(ykk, locale) + ' ' + monthName;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @param [locale] Optional locale name (defaults to empty locale)
|
|
31
|
+
*/
|
|
32
|
+
renderBrief(locale) {
|
|
33
|
+
return Locale.gettext(ykk, locale);
|
|
34
|
+
}
|
|
35
|
+
url() {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
headers: {
|
|
3
|
+
"plural-forms": string;
|
|
4
|
+
language: string;
|
|
5
|
+
};
|
|
6
|
+
contexts: {
|
|
7
|
+
"": {
|
|
8
|
+
Shabbat: string[];
|
|
9
|
+
"Achrei Mot": string[];
|
|
10
|
+
Bechukotai: string[];
|
|
11
|
+
"Beha'alotcha": string[];
|
|
12
|
+
Bereshit: string[];
|
|
13
|
+
Chukat: string[];
|
|
14
|
+
"Erev Shavuot": string[];
|
|
15
|
+
"Erev Sukkot": string[];
|
|
16
|
+
"Ki Tavo": string[];
|
|
17
|
+
"Ki Teitzei": string[];
|
|
18
|
+
"Ki Tisa": string[];
|
|
19
|
+
Matot: string[];
|
|
20
|
+
"Pesach Shabbat Chol ha-Moed": string[];
|
|
21
|
+
"Purim Katan": string[];
|
|
22
|
+
"Shabbat Chazon": string[];
|
|
23
|
+
"Shabbat HaChodesh": string[];
|
|
24
|
+
"Shabbat HaGadol": string[];
|
|
25
|
+
"Shabbat Nachamu": string[];
|
|
26
|
+
"Shabbat Parah": string[];
|
|
27
|
+
"Shabbat Shekalim": string[];
|
|
28
|
+
"Shabbat Shuva": string[];
|
|
29
|
+
"Shabbat Zachor": string[];
|
|
30
|
+
Shavuot: string[];
|
|
31
|
+
"Shavuot I": string[];
|
|
32
|
+
"Shavuot II": string[];
|
|
33
|
+
Shemot: string[];
|
|
34
|
+
"Shmini Atzeret": string[];
|
|
35
|
+
"Simchat Torah": string[];
|
|
36
|
+
Sukkot: string[];
|
|
37
|
+
"Sukkot I": string[];
|
|
38
|
+
"Sukkot II": string[];
|
|
39
|
+
"Sukkot II (CH''M)": string[];
|
|
40
|
+
"Sukkot III (CH''M)": string[];
|
|
41
|
+
"Sukkot IV (CH''M)": string[];
|
|
42
|
+
"Sukkot V (CH''M)": string[];
|
|
43
|
+
"Sukkot VI (CH''M)": string[];
|
|
44
|
+
"Sukkot VII (Hoshana Raba)": string[];
|
|
45
|
+
"Sukkot Shabbat Chol ha-Moed": string[];
|
|
46
|
+
"Ta'anit Bechorot": string[];
|
|
47
|
+
"Ta'anit Esther": string[];
|
|
48
|
+
Toldot: string[];
|
|
49
|
+
Vaetchanan: string[];
|
|
50
|
+
Yitro: string[];
|
|
51
|
+
"Vezot Haberakhah": string[];
|
|
52
|
+
Parashat: string[];
|
|
53
|
+
"Leil Selichot": string[];
|
|
54
|
+
"Shabbat Mevarchim Chodesh": string[];
|
|
55
|
+
"Shabbat Shirah": string[];
|
|
56
|
+
"Asara B'Tevet": string[];
|
|
57
|
+
"Alot HaShachar": string[];
|
|
58
|
+
"Kriat Shema, sof zeman": string[];
|
|
59
|
+
"Tefilah, sof zeman": string[];
|
|
60
|
+
"Kriat Shema, sof zeman (MGA)": string[];
|
|
61
|
+
"Tefilah, sof zeman (MGA)": string[];
|
|
62
|
+
"Chatzot HaLailah": string[];
|
|
63
|
+
"Chatzot hayom": string[];
|
|
64
|
+
"Tzeit HaKochavim": string[];
|
|
65
|
+
"Birkat Hachamah": string[];
|
|
66
|
+
"Shushan Purim Katan": string[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { "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"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "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)"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "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"] } } };
|