@hebcal/core 6.5.3 → 6.7.0

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.
Files changed (163) hide show
  1. package/README.md +4 -4
  2. package/dist/bundle.js +6525 -5562
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +18 -18
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +15 -3
  7. package/dist/esm/DailyLearning.js +1 -1
  8. package/dist/esm/HebrewDateEvent.js +1 -1
  9. package/dist/esm/HolidayEvent.js +7 -6
  10. package/dist/esm/HolidayEvent.js.map +1 -1
  11. package/dist/esm/MevarchimChodeshEvent.js +3 -2
  12. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  13. package/dist/esm/ParshaEvent.js +18 -7
  14. package/dist/esm/ParshaEvent.js.map +1 -1
  15. package/dist/esm/TimedEvent.js +1 -1
  16. package/dist/esm/TimedEvent.js.map +1 -1
  17. package/dist/esm/YomKippurKatanEvent.js +3 -2
  18. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  19. package/dist/esm/ashkenazi.po.js +2 -2
  20. package/dist/esm/ashkenazi.po.js.map +1 -1
  21. package/dist/esm/calendar.js +14 -20
  22. package/dist/esm/calendar.js.map +1 -1
  23. package/dist/esm/candles.d.ts +8 -3
  24. package/dist/esm/candles.js +65 -11
  25. package/dist/esm/candles.js.map +1 -1
  26. package/dist/esm/cities.json.js +1 -1
  27. package/dist/esm/event.js +1 -1
  28. package/dist/esm/getStartAndEnd.js +1 -1
  29. package/dist/esm/hallel.js +1 -1
  30. package/dist/esm/he-x-NoNikud.po.js +1 -1
  31. package/dist/esm/he.po.d.ts +0 -1
  32. package/dist/esm/he.po.js +2 -2
  33. package/dist/esm/he.po.js.map +1 -1
  34. package/dist/esm/hebcal.js +1 -1
  35. package/dist/esm/holidays.js +1 -1
  36. package/dist/esm/holidays.js.map +1 -1
  37. package/dist/esm/index.js +1 -1
  38. package/dist/esm/isAssurBemlacha.js +1 -1
  39. package/dist/esm/isAveilut.js +1 -1
  40. package/dist/esm/isFastDay.js +1 -1
  41. package/dist/esm/locale.js +1 -1
  42. package/dist/esm/location.js +1 -1
  43. package/dist/esm/location.js.map +1 -1
  44. package/dist/esm/modern.js +1 -1
  45. package/dist/esm/molad.d.ts +1 -1
  46. package/dist/esm/molad.js +4 -3
  47. package/dist/esm/molad.js.map +1 -1
  48. package/dist/esm/moladBase.js +1 -1
  49. package/dist/esm/moladDate.d.ts +1 -1
  50. package/dist/esm/moladDate.js +2 -2
  51. package/dist/esm/moladDate.js.map +1 -1
  52. package/dist/esm/omer.js +1 -1
  53. package/dist/esm/parshaName.js +3 -2
  54. package/dist/esm/parshaName.js.map +1 -1
  55. package/dist/esm/parshaYear.js +1 -1
  56. package/dist/esm/pkgVersion.d.ts +1 -1
  57. package/dist/esm/pkgVersion.js +2 -2
  58. package/dist/esm/pkgVersion.js.map +1 -1
  59. package/dist/esm/reformatTimeStr.js +1 -1
  60. package/dist/esm/reformatTimeStr.js.map +1 -1
  61. package/dist/esm/sedra.d.ts +14 -0
  62. package/dist/esm/sedra.js +62 -1
  63. package/dist/esm/sedra.js.map +1 -1
  64. package/dist/esm/sefira.json.js +1 -1
  65. package/dist/esm/staticHolidays.js +1 -1
  66. package/dist/esm/string.d.ts +2 -0
  67. package/dist/esm/string.js +10 -0
  68. package/dist/esm/string.js.map +1 -0
  69. package/dist/esm/tachanun.js +1 -1
  70. package/dist/esm/tachanun.js.map +1 -1
  71. package/dist/esm/zmanim.d.ts +1 -1
  72. package/dist/esm/zmanim.js +3 -4
  73. package/dist/esm/zmanim.js.map +1 -1
  74. package/package.json +18 -21
  75. package/po/ashkenazi.po +1 -12
  76. package/po/he.po +0 -3
  77. package/dist/eslint.config.d.mts +0 -83
  78. package/dist/eslint.config.mjs +0 -29
  79. package/dist/esm/temporal-shim.d.ts +0 -1
  80. package/dist/esm/temporal-shim.js +0 -11
  81. package/dist/esm/temporal-shim.js.map +0 -1
  82. package/dist/po2json.d.ts +0 -1
  83. package/dist/po2json.js +0 -40
  84. package/dist/src/CalOptions.d.ts +0 -171
  85. package/dist/src/CalOptions.js +0 -1
  86. package/dist/src/DailyLearning.d.ts +0 -69
  87. package/dist/src/DailyLearning.js +0 -92
  88. package/dist/src/HebrewDateEvent.d.ts +0 -37
  89. package/dist/src/HebrewDateEvent.js +0 -72
  90. package/dist/src/HolidayEvent.d.ts +0 -117
  91. package/dist/src/HolidayEvent.js +0 -235
  92. package/dist/src/MevarchimChodeshEvent.d.ts +0 -26
  93. package/dist/src/MevarchimChodeshEvent.js +0 -51
  94. package/dist/src/ParshaEvent.d.ts +0 -24
  95. package/dist/src/ParshaEvent.js +0 -49
  96. package/dist/src/TimedEvent.d.ts +0 -76
  97. package/dist/src/TimedEvent.js +0 -134
  98. package/dist/src/YomKippurKatanEvent.d.ts +0 -23
  99. package/dist/src/YomKippurKatanEvent.js +0 -39
  100. package/dist/src/ashkenazi.po.d.ts +0 -84
  101. package/dist/src/ashkenazi.po.js +0 -1
  102. package/dist/src/calendar.d.ts +0 -112
  103. package/dist/src/calendar.js +0 -721
  104. package/dist/src/candles.d.ts +0 -57
  105. package/dist/src/candles.js +0 -185
  106. package/dist/src/cities.json +0 -67
  107. package/dist/src/event.d.ts +0 -233
  108. package/dist/src/event.js +0 -295
  109. package/dist/src/getStartAndEnd.d.ts +0 -6
  110. package/dist/src/getStartAndEnd.js +0 -105
  111. package/dist/src/hallel.d.ts +0 -6
  112. package/dist/src/hallel.js +0 -39
  113. package/dist/src/he-x-NoNikud.po.d.ts +0 -28
  114. package/dist/src/he-x-NoNikud.po.js +0 -1
  115. package/dist/src/he.po.d.ts +0 -218
  116. package/dist/src/he.po.js +0 -1
  117. package/dist/src/hebcal.d.ts +0 -338
  118. package/dist/src/hebcal.js +0 -413
  119. package/dist/src/holidays.d.ts +0 -41
  120. package/dist/src/holidays.js +0 -324
  121. package/dist/src/index.d.ts +0 -30
  122. package/dist/src/index.js +0 -29
  123. package/dist/src/isAssurBemlacha.d.ts +0 -29
  124. package/dist/src/isAssurBemlacha.js +0 -82
  125. package/dist/src/isAveilut.d.ts +0 -22
  126. package/dist/src/isAveilut.js +0 -48
  127. package/dist/src/isFastDay.d.ts +0 -21
  128. package/dist/src/isFastDay.js +0 -31
  129. package/dist/src/locale.d.ts +0 -1
  130. package/dist/src/locale.js +0 -11
  131. package/dist/src/location.d.ts +0 -167
  132. package/dist/src/location.js +0 -342
  133. package/dist/src/modern.d.ts +0 -18
  134. package/dist/src/modern.js +0 -59
  135. package/dist/src/molad.d.ts +0 -164
  136. package/dist/src/molad.js +0 -297
  137. package/dist/src/moladBase.d.ts +0 -15
  138. package/dist/src/moladBase.js +0 -78
  139. package/dist/src/moladDate.d.ts +0 -12
  140. package/dist/src/moladDate.js +0 -58
  141. package/dist/src/omer.d.ts +0 -128
  142. package/dist/src/omer.js +0 -385
  143. package/dist/src/parshaName.d.ts +0 -2
  144. package/dist/src/parshaName.js +0 -12
  145. package/dist/src/parshaYear.d.ts +0 -20
  146. package/dist/src/parshaYear.js +0 -35
  147. package/dist/src/pkgVersion.d.ts +0 -2
  148. package/dist/src/pkgVersion.js +0 -2
  149. package/dist/src/reformatTimeStr.d.ts +0 -8
  150. package/dist/src/reformatTimeStr.js +0 -47
  151. package/dist/src/sedra.d.ts +0 -175
  152. package/dist/src/sedra.js +0 -563
  153. package/dist/src/sefira.json +0 -63
  154. package/dist/src/staticHolidays.d.ts +0 -192
  155. package/dist/src/staticHolidays.js +0 -637
  156. package/dist/src/tachanun.d.ts +0 -29
  157. package/dist/src/tachanun.js +0 -120
  158. package/dist/src/temporal-shim.d.ts +0 -1
  159. package/dist/src/temporal-shim.js +0 -8
  160. package/dist/src/zmanim.d.ts +0 -620
  161. package/dist/src/zmanim.js +0 -1003
  162. package/dist/version.d.ts +0 -1
  163. package/dist/version.js +0 -8
@@ -1,235 +0,0 @@
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
- /**
6
- * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.
7
- *
8
- * Most holiday-related events emitted by {@link HebrewCalendar.calendar}
9
- * are instances of `HolidayEvent` or one of its subclasses
10
- * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},
11
- * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).
12
- *
13
- * Adds two notable behaviors over the base {@link Event}:
14
- *
15
- * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,
16
- * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `"Erev Pesach"` →
17
- * `"Pesach"`).
18
- * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`
19
- * link for the holiday.
20
- */
21
- export class HolidayEvent extends Event {
22
- /** During Sukkot or Pesach */
23
- cholHaMoedDay;
24
- /**
25
- * `true` if the fast day was postponed a day to avoid Shabbat.
26
- * - Tish'a B'Av postponed from the 9th to the 10th
27
- * - Tzom Tammuz postponed from the 17th to the 18th
28
- */
29
- observed;
30
- constructor(date, desc, mask = 0, attrs) {
31
- super(date, desc, mask, attrs);
32
- if (typeof attrs === 'object' && attrs !== null) {
33
- Object.assign(this, attrs);
34
- }
35
- }
36
- /**
37
- * Returns a simplified (untranslated) name for this holiday, stripping
38
- * qualifiers so that related events group under one name.
39
- *
40
- * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,
41
- * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,
42
- * `: 8th Day`, and a leading `"Erev "`.
43
- * @example
44
- * // 'Erev Pesach' => 'Pesach'
45
- * // 'Sukkot III (CH''M)' => 'Sukkot'
46
- * // 'Chanukah: 5 Candles' => 'Chanukah'
47
- * // 'Rosh Hashana 5784' => 'Rosh Hashana'
48
- */
49
- basename() {
50
- return this.getDesc()
51
- .replace(/ \d{4}$/, '')
52
- .replace(/ \(CH''M\)$/, '')
53
- .replace(/ \(observed\)$/, '')
54
- .replace(/ \(Hoshana Raba\)$/, '')
55
- .replace(/ [IV]+$/, '')
56
- .replace(/: \d Candles?$/, '')
57
- .replace(/: 8th Day$/, '')
58
- .replace(/^Erev /, '');
59
- }
60
- /**
61
- * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
62
- * this holiday. Israel-only holidays get an `?i=on` query parameter.
63
- * Returns `undefined` for years outside `[100, 2999]`.
64
- */
65
- url() {
66
- const year = this.greg().getFullYear();
67
- if (year < 100 || year > 2999) {
68
- return undefined;
69
- }
70
- const url = 'https://www.hebcal.com/holidays/' +
71
- this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
72
- '-' +
73
- this.urlDateSuffix();
74
- return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
75
- }
76
- urlDateSuffix() {
77
- const year = this.greg().getFullYear();
78
- return String(year);
79
- }
80
- getEmoji() {
81
- if (this.emoji) {
82
- return this.emoji;
83
- }
84
- else if (this.getFlags() & flags.SPECIAL_SHABBAT) {
85
- return '🕍';
86
- }
87
- else {
88
- return '✡️';
89
- }
90
- }
91
- getCategories() {
92
- if (this.cholHaMoedDay) {
93
- return ['holiday', 'major', 'cholhamoed'];
94
- }
95
- const cats = super.getCategories();
96
- if (cats[0] !== 'unknown') {
97
- return cats;
98
- }
99
- // Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.
100
- const desc = this.getDesc();
101
- switch (desc) {
102
- case hdesc.LAG_BAOMER:
103
- case hdesc.LEIL_SELICHOT:
104
- case hdesc.PESACH_SHENI:
105
- case hdesc.EREV_PURIM:
106
- case hdesc.PURIM_KATAN:
107
- case hdesc.SHUSHAN_PURIM:
108
- case hdesc.TU_BAV:
109
- case hdesc.TU_BISHVAT:
110
- case hdesc.ROSH_HASHANA_LABEHEMOT:
111
- return ['holiday', 'minor'];
112
- }
113
- return ['holiday', 'major'];
114
- }
115
- /**
116
- * Returns (translated) description of this event
117
- * @param [locale] Optional locale name (defaults to empty locale)
118
- */
119
- render(locale) {
120
- const str = super.render(locale);
121
- return str.replace(/'/g, '’');
122
- }
123
- /**
124
- * Returns a brief (translated) description of this event.
125
- * For most events, this is the same as render(). For some events, it procudes
126
- * a shorter text (e.g. without a time or added description).
127
- * @param [locale] Optional locale name (defaults to empty locale)
128
- */
129
- renderBrief(locale) {
130
- const str = super.renderBrief(locale);
131
- return str.replace(/'/g, '’');
132
- }
133
- }
134
- /**
135
- * Because Asara B'Tevet often occurs twice in the same Gregorian year,
136
- * we subclass HolidayEvent to generate the correct URL.
137
- */
138
- export class AsaraBTevetEvent extends HolidayEvent {
139
- urlDateSuffix() {
140
- const isoDate = isoDateString(this.greg());
141
- return isoDate.replace(/-/g, '');
142
- }
143
- }
144
- const chanukahEmoji = '🕎';
145
- const KEYCAP_DIGITS = [
146
- '0️⃣',
147
- '1️⃣',
148
- '2️⃣',
149
- '3️⃣',
150
- '4️⃣',
151
- '5️⃣',
152
- '6️⃣',
153
- '7️⃣',
154
- '8️⃣',
155
- '9️⃣',
156
- ];
157
- /**
158
- * Because Chanukah sometimes starts in December and ends in January,
159
- * we subclass HolidayEvent to generate the correct URL.
160
- */
161
- export class ChanukahEvent extends HolidayEvent {
162
- chanukahDay;
163
- /**
164
- * @param chanukahDay should be undefined for 1st night of Chanukah
165
- */
166
- constructor(date, desc, mask, chanukahDay) {
167
- super(date, desc, mask);
168
- this.chanukahDay = chanukahDay;
169
- this.emoji = chanukahEmoji;
170
- if (chanukahDay !== 8) {
171
- const candles = chanukahDay ? chanukahDay + 1 : 1;
172
- this.emoji += KEYCAP_DIGITS[candles];
173
- }
174
- }
175
- urlDateSuffix() {
176
- const dt = this.greg();
177
- let year = dt.getFullYear();
178
- if (dt.getMonth() === 0) {
179
- year--;
180
- }
181
- return String(year);
182
- }
183
- }
184
- /** Represents Rosh Hashana, the Jewish New Year */
185
- export class RoshHashanaEvent extends HolidayEvent {
186
- hyear;
187
- /**
188
- * @private
189
- * @param date Hebrew date event occurs
190
- * @param hyear Hebrew year
191
- * @param mask optional holiday flags
192
- */
193
- constructor(date, hyear, mask) {
194
- super(date, `Rosh Hashana ${hyear}`, mask);
195
- this.hyear = hyear;
196
- }
197
- /**
198
- * Returns (translated) description of this event
199
- * @param [locale] Optional locale name (defaults to empty locale)
200
- */
201
- render(locale) {
202
- return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;
203
- }
204
- getEmoji() {
205
- return '🍏🍯';
206
- }
207
- }
208
- const roshChodeshStr = 'Rosh Chodesh';
209
- /** Represents Rosh Chodesh, the beginning of a new month */
210
- export class RoshChodeshEvent extends HolidayEvent {
211
- /**
212
- * Constructs Rosh Chodesh event
213
- * @param date Hebrew date event occurs
214
- * @param monthName Hebrew month name (not translated)
215
- */
216
- constructor(date, monthName) {
217
- super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);
218
- }
219
- /**
220
- * Returns (translated) description of this event
221
- * @param [locale] Optional locale name (defaults to empty locale)
222
- */
223
- render(locale) {
224
- const monthName = this.getDesc().substring(roshChodeshStr.length + 1);
225
- const monthName0 = Locale.gettext(monthName, locale);
226
- const monthName1 = monthName0.replace(/'/g, '’');
227
- return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;
228
- }
229
- basename() {
230
- return this.getDesc();
231
- }
232
- getEmoji() {
233
- return this.emoji || '🌒';
234
- }
235
- }
@@ -1,26 +0,0 @@
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
- }
@@ -1,51 +0,0 @@
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
- monthName;
9
- /**
10
- * Constructs Mevarchim haChodesh event
11
- * @param date Hebrew date event occurs
12
- * @param monthName Hebrew month name (not translated)
13
- * @param [memo]
14
- * @param locale Optional locale name
15
- */
16
- constructor(date, monthName, memo, locale) {
17
- super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
18
- this.monthName = Locale.gettext(monthName, locale);
19
- if (memo) {
20
- this.memo = memo;
21
- }
22
- else {
23
- const hyear = date.getFullYear();
24
- const hmonth = date.getMonth();
25
- const monNext = hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;
26
- const molad = new Molad(hyear, monNext);
27
- this.memo = molad.render('en', { hour12: false });
28
- }
29
- }
30
- basename() {
31
- return this.getDesc();
32
- }
33
- /**
34
- * Returns (translated) description of this event
35
- * @param [locale] Optional locale name (defaults to empty locale)
36
- */
37
- render(locale) {
38
- const monthName0 = Locale.gettext(this.monthName, locale);
39
- const monthName = monthName0.replace(/'/g, '’');
40
- return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;
41
- }
42
- /**
43
- * Returns (translated) description of this event
44
- * @param [locale] Optional locale name (defaults to empty locale)
45
- */
46
- renderBrief(locale) {
47
- const str = this.render(locale);
48
- const space = str.indexOf(' ');
49
- return str.substring(space + 1);
50
- }
51
- }
@@ -1,24 +0,0 @@
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
- * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot
8
- * with holiday readings such as Shabbat Chol ha-Moed, use
9
- * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from
10
- * `@hebcal/leyning` when the display title and exact Torah readings are needed.
11
- */
12
- export declare class ParshaEvent extends Event {
13
- readonly p: SedraResult;
14
- constructor(parsha: SedraResult);
15
- /**
16
- * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.
17
- */
18
- render(locale?: string): string;
19
- basename(): string;
20
- url(): string | undefined;
21
- urlDateSuffix(): string;
22
- /** convenience function for compatibility with previous implementation */
23
- get parsha(): string[];
24
- }
@@ -1,49 +0,0 @@
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
- * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot
9
- * with holiday readings such as Shabbat Chol ha-Moed, use
10
- * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from
11
- * `@hebcal/leyning` when the display title and exact Torah readings are needed.
12
- */
13
- export class ParshaEvent extends Event {
14
- p;
15
- constructor(parsha) {
16
- const desc = 'Parashat ' + parsha.parsha.join('-');
17
- super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);
18
- this.p = parsha;
19
- }
20
- /**
21
- * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.
22
- */
23
- render(locale) {
24
- return renderParshaName(this.p.parsha, locale);
25
- }
26
- basename() {
27
- return this.p.parsha.join('-');
28
- }
29
- url() {
30
- const year = this.greg().getFullYear();
31
- if (year < 100 || year > 2999) {
32
- return undefined;
33
- }
34
- const dt = this.urlDateSuffix();
35
- const url = 'https://www.hebcal.com/sedrot/' +
36
- this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +
37
- '-' +
38
- dt;
39
- return this.p.il ? url + '?i=on' : url;
40
- }
41
- urlDateSuffix() {
42
- const isoDate = isoDateString(this.greg());
43
- return isoDate.replace(/-/g, '');
44
- }
45
- /** convenience function for compatibility with previous implementation */
46
- get parsha() {
47
- return this.p.parsha;
48
- }
49
- }
@@ -1,76 +0,0 @@
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
- /**
7
- * Base class for events that have an associated wall-clock time and
8
- * geographic location — for example, candle lighting, havdalah, and
9
- * fast begin/end times.
10
- *
11
- * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour
12
- * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a
13
- * "linked" event such as the holiday whose candle-lighting time this
14
- * represents.
15
- */
16
- export declare class TimedEvent extends Event {
17
- /** The exact moment of the event, rounded to the nearest minute */
18
- readonly eventTime: Date;
19
- /** Geographic location used to compute `eventTime` */
20
- readonly location: Location;
21
- /** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
22
- readonly eventTimeStr: string;
23
- /** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
24
- readonly fmtTime: string;
25
- /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
26
- readonly linkedEvent?: Event;
27
- /**
28
- * @param desc Description (not translated)
29
- */
30
- constructor(date: HDate, desc: string, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
31
- /**
32
- * @param [locale] Optional locale name (defaults to empty locale)
33
- */
34
- render(locale?: string): string;
35
- /**
36
- * Returns translation of "Candle lighting" without the time.
37
- * @param [locale] Optional locale name (defaults to empty locale)
38
- */
39
- renderBrief(locale?: string): string;
40
- getCategories(): string[];
41
- }
42
- /**
43
- * Candle-lighting event for the eve of Shabbat or a Yom Tov.
44
- *
45
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
46
- * is `true` and `options.location` is provided. By default candle lighting
47
- * occurs 18 minutes before sundown (40 minutes in Jerusalem; 30 minutes in
48
- * Haifa and Zikhron Ya'akov), configurable via `options.candleLightingMins`.
49
- */
50
- export declare class CandleLightingEvent extends TimedEvent {
51
- constructor(date: HDate, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
52
- getEmoji(): string;
53
- }
54
- /**
55
- * Havdalah event marking the end of Shabbat or a Yom Tov.
56
- *
57
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
58
- * is `true` and `options.location` is provided. By default Havdalah is
59
- * calculated by *tzeit hakochavim* (8.5° solar depression); pass
60
- * `options.havdalahMins` to use a fixed minute offset instead, or
61
- * `options.havdalahDeg` to use a different degree.
62
- */
63
- export declare class HavdalahEvent extends TimedEvent {
64
- private readonly havdalahMins?;
65
- constructor(date: HDate, mask: number, eventTime: Date, location: Location, havdalahMins?: number, linkedEvent?: Event, options?: CalOptions);
66
- /**
67
- * @param [locale] Optional locale name (defaults to empty locale)
68
- */
69
- render(locale?: string): string;
70
- /**
71
- * Returns translation of "Havdalah" without the time.
72
- * @param [locale] Optional locale name (defaults to empty locale)
73
- */
74
- renderBrief(locale?: string): string;
75
- getEmoji(): string;
76
- }
@@ -1,134 +0,0 @@
1
- import { Locale } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- import { reformatTimeStr } from './reformatTimeStr';
4
- import { Zmanim } from './zmanim';
5
- import { holidayDesc as hdesc } from './staticHolidays';
6
- import './locale'; // Adds Hebrew and Ashkenazic translations
7
- const HAVDALAH = hdesc.HAVDALAH;
8
- const CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;
9
- /**
10
- * Base class for events that have an associated wall-clock time and
11
- * geographic location — for example, candle lighting, havdalah, and
12
- * fast begin/end times.
13
- *
14
- * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour
15
- * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a
16
- * "linked" event such as the holiday whose candle-lighting time this
17
- * represents.
18
- */
19
- export class TimedEvent extends Event {
20
- /** The exact moment of the event, rounded to the nearest minute */
21
- eventTime;
22
- /** Geographic location used to compute `eventTime` */
23
- location;
24
- /** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
25
- eventTimeStr;
26
- /** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
27
- fmtTime;
28
- /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
29
- linkedEvent;
30
- /**
31
- * @param desc Description (not translated)
32
- */
33
- constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
34
- super(date, desc, mask);
35
- this.eventTime = Zmanim.roundTime(eventTime);
36
- this.location = location;
37
- const timeFormat = location.getTimeFormatter();
38
- this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);
39
- const opts = { ...options, location };
40
- this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);
41
- if (linkedEvent !== undefined) {
42
- this.linkedEvent = linkedEvent;
43
- }
44
- }
45
- /**
46
- * @param [locale] Optional locale name (defaults to empty locale)
47
- */
48
- render(locale) {
49
- return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;
50
- }
51
- /**
52
- * Returns translation of "Candle lighting" without the time.
53
- * @param [locale] Optional locale name (defaults to empty locale)
54
- */
55
- renderBrief(locale) {
56
- return Locale.gettext(this.getDesc(), locale);
57
- }
58
- getCategories() {
59
- const desc = this.getDesc();
60
- switch (desc) {
61
- // LIGHT_CANDLES or LIGHT_CANDLES_TZEIS
62
- case CANDLE_LIGHTING:
63
- return ['candles'];
64
- // YOM_TOV_ENDS
65
- case HAVDALAH:
66
- return ['havdalah'];
67
- // flags.MINOR_FAST or flags.MAJOR_FAST
68
- case hdesc.FAST_BEGINS:
69
- case hdesc.FAST_ENDS:
70
- return ['zmanim', 'fast'];
71
- case hdesc.SOF_ZMAN_ACHILAT_CHAMETZ:
72
- return ['zmanim', 'achilasChametz'];
73
- case hdesc.BIUR_CHAMETZ:
74
- return ['zmanim', 'biurChametz'];
75
- }
76
- /* NOTREACHED */
77
- return ['unknown'];
78
- }
79
- }
80
- /**
81
- * Candle-lighting event for the eve of Shabbat or a Yom Tov.
82
- *
83
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
84
- * is `true` and `options.location` is provided. By default candle lighting
85
- * occurs 18 minutes before sundown (40 minutes in Jerusalem; 30 minutes in
86
- * Haifa and Zikhron Ya'akov), configurable via `options.candleLightingMins`.
87
- */
88
- export class CandleLightingEvent extends TimedEvent {
89
- constructor(date, mask, eventTime, location, linkedEvent, options) {
90
- super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);
91
- }
92
- getEmoji() {
93
- return '🕯️';
94
- }
95
- }
96
- /**
97
- * Havdalah event marking the end of Shabbat or a Yom Tov.
98
- *
99
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
100
- * is `true` and `options.location` is provided. By default Havdalah is
101
- * calculated by *tzeit hakochavim* (8.5° solar depression); pass
102
- * `options.havdalahMins` to use a fixed minute offset instead, or
103
- * `options.havdalahDeg` to use a different degree.
104
- */
105
- export class HavdalahEvent extends TimedEvent {
106
- havdalahMins;
107
- constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
108
- super(date, HAVDALAH, mask, eventTime, location, linkedEvent, options);
109
- if (havdalahMins) {
110
- this.havdalahMins = havdalahMins;
111
- }
112
- }
113
- /**
114
- * @param [locale] Optional locale name (defaults to empty locale)
115
- */
116
- render(locale) {
117
- return this.renderBrief(locale) + ': ' + this.fmtTime;
118
- }
119
- /**
120
- * Returns translation of "Havdalah" without the time.
121
- * @param [locale] Optional locale name (defaults to empty locale)
122
- */
123
- renderBrief(locale) {
124
- let str = Locale.gettext(this.getDesc(), locale);
125
- if (this.havdalahMins) {
126
- const min = Locale.gettext('min', locale);
127
- str += ` (${this.havdalahMins} ${min})`;
128
- }
129
- return str;
130
- }
131
- getEmoji() {
132
- return '✨';
133
- }
134
- }
@@ -1,23 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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
- nextMonthName;
9
- /**
10
- * @private
11
- * @param date Hebrew date event occurs
12
- * @param nextMonthName name of the upcoming month
13
- */
14
- constructor(date, nextMonthName) {
15
- super(date, `${ykk} ${nextMonthName}`, flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN);
16
- this.nextMonthName = nextMonthName;
17
- this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;
18
- }
19
- basename() {
20
- return this.getDesc();
21
- }
22
- /**
23
- * @param [locale] Optional locale name (defaults to empty locale)
24
- */
25
- render(locale) {
26
- const monthName0 = Locale.gettext(this.nextMonthName, locale);
27
- const monthName = monthName0.replace(/'/g, '’');
28
- return Locale.gettext(ykk, locale) + ' ' + monthName;
29
- }
30
- /**
31
- * @param [locale] Optional locale name (defaults to empty locale)
32
- */
33
- renderBrief(locale) {
34
- return Locale.gettext(ykk, locale);
35
- }
36
- url() {
37
- return undefined;
38
- }
39
- }