@hebcal/core 6.6.0 → 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 (147) hide show
  1. package/README.md +4 -4
  2. package/dist/bundle.js +183 -50
  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 +1 -1
  10. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  11. package/dist/esm/ParshaEvent.js +16 -6
  12. package/dist/esm/ParshaEvent.js.map +1 -1
  13. package/dist/esm/TimedEvent.js +1 -1
  14. package/dist/esm/TimedEvent.js.map +1 -1
  15. package/dist/esm/YomKippurKatanEvent.js +1 -1
  16. package/dist/esm/ashkenazi.po.js +2 -2
  17. package/dist/esm/ashkenazi.po.js.map +1 -1
  18. package/dist/esm/calendar.js +14 -20
  19. package/dist/esm/calendar.js.map +1 -1
  20. package/dist/esm/candles.d.ts +8 -3
  21. package/dist/esm/candles.js +65 -11
  22. package/dist/esm/candles.js.map +1 -1
  23. package/dist/esm/cities.json.js +1 -1
  24. package/dist/esm/event.js +1 -1
  25. package/dist/esm/getStartAndEnd.js +1 -1
  26. package/dist/esm/hallel.js +1 -1
  27. package/dist/esm/he-x-NoNikud.po.js +1 -1
  28. package/dist/esm/he.po.js +1 -1
  29. package/dist/esm/hebcal.js +1 -1
  30. package/dist/esm/holidays.js +1 -1
  31. package/dist/esm/holidays.js.map +1 -1
  32. package/dist/esm/index.js +1 -1
  33. package/dist/esm/isAssurBemlacha.js +1 -1
  34. package/dist/esm/isAveilut.js +1 -1
  35. package/dist/esm/isFastDay.js +1 -1
  36. package/dist/esm/locale.js +1 -1
  37. package/dist/esm/location.js +1 -1
  38. package/dist/esm/location.js.map +1 -1
  39. package/dist/esm/modern.js +1 -1
  40. package/dist/esm/molad.js +1 -1
  41. package/dist/esm/moladBase.js +1 -1
  42. package/dist/esm/moladDate.js +1 -1
  43. package/dist/esm/moladDate.js.map +1 -1
  44. package/dist/esm/omer.js +1 -1
  45. package/dist/esm/parshaName.js +1 -1
  46. package/dist/esm/parshaYear.js +1 -1
  47. package/dist/esm/pkgVersion.d.ts +1 -1
  48. package/dist/esm/pkgVersion.js +2 -2
  49. package/dist/esm/pkgVersion.js.map +1 -1
  50. package/dist/esm/reformatTimeStr.js +1 -1
  51. package/dist/esm/reformatTimeStr.js.map +1 -1
  52. package/dist/esm/sedra.d.ts +14 -0
  53. package/dist/esm/sedra.js +62 -1
  54. package/dist/esm/sedra.js.map +1 -1
  55. package/dist/esm/sefira.json.js +1 -1
  56. package/dist/esm/staticHolidays.js +1 -1
  57. package/dist/esm/string.js +1 -1
  58. package/dist/esm/tachanun.js +1 -1
  59. package/dist/esm/tachanun.js.map +1 -1
  60. package/dist/esm/zmanim.js +2 -3
  61. package/dist/esm/zmanim.js.map +1 -1
  62. package/package.json +14 -17
  63. package/po/ashkenazi.po +1 -12
  64. package/dist/eslint.config.d.mts +0 -83
  65. package/dist/eslint.config.mjs +0 -29
  66. package/dist/po2json.d.ts +0 -1
  67. package/dist/po2json.js +0 -40
  68. package/dist/src/CalOptions.d.ts +0 -171
  69. package/dist/src/CalOptions.js +0 -1
  70. package/dist/src/DailyLearning.d.ts +0 -69
  71. package/dist/src/DailyLearning.js +0 -92
  72. package/dist/src/HebrewDateEvent.d.ts +0 -37
  73. package/dist/src/HebrewDateEvent.js +0 -72
  74. package/dist/src/HolidayEvent.d.ts +0 -117
  75. package/dist/src/HolidayEvent.js +0 -236
  76. package/dist/src/MevarchimChodeshEvent.d.ts +0 -26
  77. package/dist/src/MevarchimChodeshEvent.js +0 -52
  78. package/dist/src/ParshaEvent.d.ts +0 -24
  79. package/dist/src/ParshaEvent.js +0 -50
  80. package/dist/src/TimedEvent.d.ts +0 -76
  81. package/dist/src/TimedEvent.js +0 -134
  82. package/dist/src/YomKippurKatanEvent.d.ts +0 -23
  83. package/dist/src/YomKippurKatanEvent.js +0 -40
  84. package/dist/src/ashkenazi.po.d.ts +0 -84
  85. package/dist/src/ashkenazi.po.js +0 -1
  86. package/dist/src/calendar.d.ts +0 -112
  87. package/dist/src/calendar.js +0 -721
  88. package/dist/src/candles.d.ts +0 -57
  89. package/dist/src/candles.js +0 -185
  90. package/dist/src/cities.json +0 -67
  91. package/dist/src/event.d.ts +0 -233
  92. package/dist/src/event.js +0 -295
  93. package/dist/src/getStartAndEnd.d.ts +0 -6
  94. package/dist/src/getStartAndEnd.js +0 -105
  95. package/dist/src/hallel.d.ts +0 -6
  96. package/dist/src/hallel.js +0 -39
  97. package/dist/src/he-x-NoNikud.po.d.ts +0 -28
  98. package/dist/src/he-x-NoNikud.po.js +0 -1
  99. package/dist/src/he.po.d.ts +0 -217
  100. package/dist/src/he.po.js +0 -1
  101. package/dist/src/hebcal.d.ts +0 -338
  102. package/dist/src/hebcal.js +0 -413
  103. package/dist/src/holidays.d.ts +0 -41
  104. package/dist/src/holidays.js +0 -324
  105. package/dist/src/index.d.ts +0 -30
  106. package/dist/src/index.js +0 -29
  107. package/dist/src/isAssurBemlacha.d.ts +0 -29
  108. package/dist/src/isAssurBemlacha.js +0 -82
  109. package/dist/src/isAveilut.d.ts +0 -22
  110. package/dist/src/isAveilut.js +0 -48
  111. package/dist/src/isFastDay.d.ts +0 -21
  112. package/dist/src/isFastDay.js +0 -31
  113. package/dist/src/locale.d.ts +0 -1
  114. package/dist/src/locale.js +0 -11
  115. package/dist/src/location.d.ts +0 -167
  116. package/dist/src/location.js +0 -342
  117. package/dist/src/modern.d.ts +0 -18
  118. package/dist/src/modern.js +0 -59
  119. package/dist/src/molad.d.ts +0 -164
  120. package/dist/src/molad.js +0 -298
  121. package/dist/src/moladBase.d.ts +0 -15
  122. package/dist/src/moladBase.js +0 -78
  123. package/dist/src/moladDate.d.ts +0 -12
  124. package/dist/src/moladDate.js +0 -58
  125. package/dist/src/omer.d.ts +0 -128
  126. package/dist/src/omer.js +0 -385
  127. package/dist/src/parshaName.d.ts +0 -2
  128. package/dist/src/parshaName.js +0 -13
  129. package/dist/src/parshaYear.d.ts +0 -20
  130. package/dist/src/parshaYear.js +0 -35
  131. package/dist/src/pkgVersion.d.ts +0 -2
  132. package/dist/src/pkgVersion.js +0 -2
  133. package/dist/src/reformatTimeStr.d.ts +0 -8
  134. package/dist/src/reformatTimeStr.js +0 -47
  135. package/dist/src/sedra.d.ts +0 -175
  136. package/dist/src/sedra.js +0 -563
  137. package/dist/src/sefira.json +0 -63
  138. package/dist/src/staticHolidays.d.ts +0 -192
  139. package/dist/src/staticHolidays.js +0 -637
  140. package/dist/src/string.d.ts +0 -2
  141. package/dist/src/string.js +0 -6
  142. package/dist/src/tachanun.d.ts +0 -29
  143. package/dist/src/tachanun.js +0 -120
  144. package/dist/src/zmanim.d.ts +0 -620
  145. package/dist/src/zmanim.js +0 -1003
  146. package/dist/version.d.ts +0 -1
  147. package/dist/version.js +0 -8
package/dist/src/event.js DELETED
@@ -1,295 +0,0 @@
1
- import { HDate, Locale } from '@hebcal/hdate';
2
- import './locale'; // Adds Hebrew and Ashkenazic translations
3
- /**
4
- * Holiday flags for Event. These flags are typically
5
- * combined using bitwise arithmetic to form a mask.
6
- * @readonly
7
- * @enum {number}
8
- */
9
- export const flags = {
10
- /** Chag, yontiff, yom tov */
11
- CHAG: 0x000001,
12
- /** Light candles 18 minutes before sundown */
13
- LIGHT_CANDLES: 0x000002,
14
- /** End of holiday (end of Yom Tov) */
15
- YOM_TOV_ENDS: 0x000004,
16
- /** Observed only in the Diaspora (chutz l'aretz) */
17
- CHUL_ONLY: 0x000008,
18
- /** Observed only in Israel */
19
- IL_ONLY: 0x000010,
20
- /** Light candles in the evening at Tzeit time (3 small stars) */
21
- LIGHT_CANDLES_TZEIS: 0x000020,
22
- /** Candle-lighting for Chanukah */
23
- CHANUKAH_CANDLES: 0x000040,
24
- /** Rosh Chodesh, beginning of a new Hebrew month */
25
- ROSH_CHODESH: 0x000080,
26
- /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */
27
- MINOR_FAST: 0x000100,
28
- /** Shabbat Shekalim, Zachor, ... */
29
- SPECIAL_SHABBAT: 0x000200,
30
- /** Weekly sedrot on Saturdays */
31
- PARSHA_HASHAVUA: 0x000400,
32
- /** Daily page of Talmud (Bavli) */
33
- DAF_YOMI: 0x000800,
34
- /** Days of the Omer */
35
- OMER_COUNT: 0x001000,
36
- /** Yom HaShoah, Yom HaAtzma'ut, ... */
37
- MODERN_HOLIDAY: 0x002000,
38
- /** Yom Kippur and Tish'a B'Av */
39
- MAJOR_FAST: 0x004000,
40
- /** On the Saturday before Rosh Chodesh */
41
- SHABBAT_MEVARCHIM: 0x008000,
42
- /** Molad */
43
- MOLAD: 0x010000,
44
- /** Yahrzeit or Hebrew Anniversary */
45
- USER_EVENT: 0x020000,
46
- /** Daily Hebrew date ("11th of Sivan, 5780") */
47
- HEBREW_DATE: 0x040000,
48
- /** A holiday that's not major, modern, rosh chodesh, or a fast day */
49
- MINOR_HOLIDAY: 0x080000,
50
- /** Evening before a major or minor holiday */
51
- EREV: 0x100000,
52
- /** Chol haMoed, intermediate days of Pesach or Sukkot */
53
- CHOL_HAMOED: 0x200000,
54
- /** Mishna Yomi */
55
- MISHNA_YOMI: 0x400000,
56
- /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */
57
- YOM_KIPPUR_KATAN: 0x800000,
58
- /** Daily page of Jerusalem Talmud (Yerushalmi) */
59
- YERUSHALMI_YOMI: 0x1000000,
60
- /** Nach Yomi */
61
- NACH_YOMI: 0x2000000,
62
- /** Daily Learning */
63
- DAILY_LEARNING: 0x4000000,
64
- /** Yizkor */
65
- YIZKOR: 0x8000000,
66
- /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */
67
- BEHAB: 0x10000000,
68
- };
69
- const flagToCategory = [
70
- [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],
71
- [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],
72
- [flags.HEBREW_DATE, 'hebdate'],
73
- [flags.MINOR_FAST, 'holiday', 'fast'],
74
- [flags.MINOR_HOLIDAY, 'holiday', 'minor'],
75
- [flags.MODERN_HOLIDAY, 'holiday', 'modern'],
76
- [flags.MOLAD, 'molad'],
77
- [flags.OMER_COUNT, 'omer'],
78
- [flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat
79
- [flags.ROSH_CHODESH, 'roshchodesh'],
80
- [flags.SHABBAT_MEVARCHIM, 'mevarchim'],
81
- [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],
82
- [flags.USER_EVENT, 'user'],
83
- [flags.YIZKOR, 'yizkor'],
84
- ];
85
- /**
86
- * Represents an Event with a title, date, and flags.
87
- *
88
- * Events are used to represent holidays, candle-lighting times,
89
- * Torah readings, Omer days, Hebrew dates, and more. Most concrete event
90
- * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},
91
- * {@link ParshaEvent}, {@link OmerEvent}) and are produced by
92
- * {@link HebrewCalendar.calendar}.
93
- *
94
- * To get the title of the event in a language other than English with
95
- * Sephardic transliterations, use the {@link Event.render} method.
96
- *
97
- * @example
98
- * import {Event, HDate, flags} from '@hebcal/core';
99
- * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
100
- * ev.getDate().toString(); // '6 Sivan 5749'
101
- * ev.getDesc(); // 'Shavuot'
102
- * ev.render('he'); // 'שָׁבוּעוֹת'
103
- */
104
- export class Event {
105
- /** Hebrew date of this event */
106
- date;
107
- /**
108
- * Untranslated title of this event. Note that these description
109
- * strings are always in English and will remain stable across releases.
110
- * To get the title of the event in another language, use the
111
- * `render()` method.
112
- */
113
- desc;
114
- /** Bitmask of optional event flags. See {@link flags} */
115
- mask;
116
- /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */
117
- emoji;
118
- /** Optional longer description or memo text */
119
- memo;
120
- /** Alarms are used by iCalendar feeds */
121
- alarm;
122
- /**
123
- * Constructs Event
124
- * @param date Hebrew date event occurs
125
- * @param desc Description (not translated)
126
- * @param [mask=0] optional bitmask of holiday flags (see {@link flags})
127
- * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)
128
- */
129
- constructor(date, desc, mask = 0, attrs) {
130
- if (!HDate.isHDate(date)) {
131
- throw new TypeError(`Invalid Event date: ${date}`);
132
- }
133
- else if (typeof desc !== 'string') {
134
- throw new TypeError(`Invalid Event description: ${desc}`);
135
- }
136
- this.date = date;
137
- this.desc = desc;
138
- this.mask = +mask;
139
- if (typeof attrs === 'object' && attrs !== null) {
140
- Object.assign(this, attrs);
141
- }
142
- }
143
- /**
144
- * Hebrew date of this event
145
- */
146
- getDate() {
147
- return this.date;
148
- }
149
- /**
150
- * Gregorian date of this event
151
- */
152
- greg() {
153
- return this.date.greg();
154
- }
155
- /**
156
- * Untranslated title of this event. Note that these description
157
- * strings are always in English and will remain stable across releases.
158
- * To get the title of the event in another language, use the
159
- * `render()` method.
160
- */
161
- getDesc() {
162
- return this.desc;
163
- }
164
- /**
165
- * Bitmask of optional event flags. See {@link flags}
166
- */
167
- getFlags() {
168
- return this.mask;
169
- }
170
- /**
171
- * Returns (translated) description of this event
172
- * @example
173
- * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
174
- * ev.render('en'); // 'Shavuot'
175
- * ev.render('he'); // 'שָׁבוּעוֹת'
176
- * ev.render('ashkenazi'); // 'Shavuos'
177
- * @param [locale] Optional locale name (defaults to empty locale)
178
- */
179
- render(locale) {
180
- return Locale.gettext(this.desc, locale);
181
- }
182
- /**
183
- * Returns a brief (translated) description of this event.
184
- *
185
- * For most events this is the same as {@link render}. Some subclasses
186
- * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent},
187
- * {@link OmerEvent}) produce shorter text without an attached time or
188
- * extra qualifier — useful for compact UI display.
189
- * @example
190
- * import {CandleLightingEvent} from '@hebcal/core';
191
- * // For a regular Event, renderBrief() == render():
192
- * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);
193
- * ev.renderBrief('en'); // 'Shavuot'
194
- * @param [locale] Optional locale name (defaults to empty locale)
195
- */
196
- renderBrief(locale) {
197
- return this.render(locale);
198
- }
199
- /**
200
- * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`),
201
- * or `null` if no emoji is associated with this event.
202
- * Subclasses override this to provide holiday-specific emoji.
203
- */
204
- getEmoji() {
205
- return this.emoji || null;
206
- }
207
- /**
208
- * Returns a simplified (untranslated) description for this event, suitable
209
- * for grouping related events under a single name.
210
- *
211
- * For example, {@link HolidayEvent} strips qualifiers so that
212
- * `"Erev Pesach"` → `"Pesach"` and `"Sukkot III (CH''M)"` → `"Sukkot"`.
213
- * For many events the basename and the event description are identical.
214
- * @example
215
- * import {HolidayEvent, HDate, months, flags} from '@hebcal/core';
216
- * const ev = new HolidayEvent(
217
- * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV);
218
- * ev.getDesc(); // 'Erev Pesach'
219
- * ev.basename(); // 'Pesach'
220
- */
221
- basename() {
222
- return this.getDesc();
223
- }
224
- /**
225
- * Returns a URL to hebcal.com or sefaria.org for more detail on the event,
226
- * or `undefined` for events with no detail page.
227
- *
228
- * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent},
229
- * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent}
230
- * override this with their own URL patterns.
231
- */
232
- url() {
233
- return undefined;
234
- }
235
- /**
236
- * Is this event observed in Israel?
237
- * @example
238
- * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
239
- * ev1.observedInIsrael(); // false
240
- * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
241
- * ev2.observedInIsrael(); // true
242
- */
243
- observedInIsrael() {
244
- return !(this.mask & flags.CHUL_ONLY);
245
- }
246
- /**
247
- * Is this event observed in the Diaspora?
248
- * @example
249
- * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
250
- * ev1.observedInDiaspora(); // true
251
- * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
252
- * ev2.observedInDiaspora(); // true
253
- */
254
- observedInDiaspora() {
255
- return !(this.mask & flags.IL_ONLY);
256
- }
257
- /**
258
- * Is this event observed in Israel/Diaspora?
259
- * @example
260
- * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);
261
- * ev1.observedIn(false); // true
262
- * ev1.observedIn(true); // false
263
- * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);
264
- * ev2.observedIn(false); // true
265
- * ev2.observedIn(true); // true
266
- * @param il
267
- */
268
- observedIn(il) {
269
- return il ? this.observedInIsrael() : this.observedInDiaspora();
270
- }
271
- /**
272
- * Returns an array of category strings classifying this event, derived
273
- * from its {@link flags} bitmask. The first element is the broad category
274
- * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed
275
- * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`).
276
- *
277
- * Returns `['unknown']` if no flag maps to a known category.
278
- * @example
279
- * import {Event, HDate, flags} from '@hebcal/core';
280
- * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST)
281
- * .getCategories(); // ['holiday', 'major', 'fast']
282
- * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\'vat', flags.ROSH_CHODESH)
283
- * .getCategories(); // ['roshchodesh']
284
- */
285
- getCategories() {
286
- const mask = this.getFlags();
287
- for (const attrs of flagToCategory) {
288
- const attr0 = attrs[0];
289
- if (mask & attr0) {
290
- return attrs.slice(1);
291
- }
292
- }
293
- return ['unknown'];
294
- }
295
- }
@@ -1,6 +0,0 @@
1
- import { CalOptions } from './CalOptions';
2
- /**
3
- * Parse options object to determine start & end days
4
- * @private
5
- */
6
- export declare function getStartAndEnd(options: CalOptions): number[];
@@ -1,105 +0,0 @@
1
- import { greg2abs, isDate, daysInGregMonth, HDate, months } from '@hebcal/hdate';
2
- const TISHREI = months.TISHREI;
3
- /**
4
- * Gets the R.D. days for a number, Date, or HDate
5
- * @private
6
- */
7
- function getAbs(d) {
8
- if (typeof d === 'number')
9
- return d;
10
- if (isDate(d))
11
- return greg2abs(d);
12
- if (HDate.isHDate(d))
13
- return d.abs();
14
- throw new TypeError(`Invalid date type: ${d}`);
15
- }
16
- function getYear(options) {
17
- if (options.year !== undefined) {
18
- return Number(options.year);
19
- }
20
- return options.isHebrewYear
21
- ? new HDate().getFullYear()
22
- : new Date().getFullYear();
23
- }
24
- const MAX_NUM_YEARS = 2000;
25
- /**
26
- * Parse options object to determine start & end days
27
- * @private
28
- */
29
- export function getStartAndEnd(options) {
30
- if ((options.start && !options.end) || (options.end && !options.start)) {
31
- throw new TypeError('Both options.start and options.end are required');
32
- }
33
- else if (options.start && options.end) {
34
- const start = getAbs(options.start), end = getAbs(options.end);
35
- if (end - start > 365 * MAX_NUM_YEARS) {
36
- throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);
37
- }
38
- return [start, end];
39
- }
40
- const isHebrewYear = Boolean(options.isHebrewYear);
41
- const theYear = getYear(options);
42
- if (isNaN(theYear)) {
43
- throw new RangeError(`Invalid year ${options.year}`);
44
- }
45
- else if (isHebrewYear && theYear < 1) {
46
- throw new RangeError(`Invalid Hebrew year ${theYear}`);
47
- }
48
- const theMonth = getMonth(options);
49
- const numYears = Number(options.numYears) || 1;
50
- if (numYears > MAX_NUM_YEARS) {
51
- throw new RangeError(`options.numYears exceeds ${MAX_NUM_YEARS}`);
52
- }
53
- if (isHebrewYear) {
54
- return startEndHebrew(theMonth, theYear, numYears);
55
- }
56
- else {
57
- return startEndGregorian(theMonth, theYear, numYears);
58
- }
59
- }
60
- function getMonth(options) {
61
- if (options.month) {
62
- if (options.isHebrewYear) {
63
- return HDate.monthNum(options.month);
64
- }
65
- else if (typeof options.month === 'number') {
66
- return options.month;
67
- }
68
- }
69
- return NaN;
70
- }
71
- function startEndGregorian(theMonth, theYear, numYears) {
72
- const gregMonth = theMonth ? theMonth - 1 : 0;
73
- const startGreg = new Date(theYear, gregMonth, 1);
74
- if (theYear < 100) {
75
- startGreg.setFullYear(theYear);
76
- }
77
- const startAbs = greg2abs(startGreg);
78
- let endAbs;
79
- if (theMonth) {
80
- endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;
81
- }
82
- else {
83
- const endYear = theYear + numYears;
84
- const endGreg = new Date(endYear, 0, 1);
85
- if (endYear < 100) {
86
- endGreg.setFullYear(endYear);
87
- }
88
- endAbs = greg2abs(endGreg) - 1;
89
- }
90
- return [startAbs, endAbs];
91
- }
92
- function startEndHebrew(theMonth, theYear, numYears) {
93
- const startDate = new HDate(1, theMonth || TISHREI, theYear);
94
- let startAbs = startDate.abs();
95
- const endAbs = theMonth
96
- ? startAbs + startDate.daysInMonth()
97
- : new HDate(1, TISHREI, theYear + numYears).abs() - 1;
98
- // for full Hebrew year, start on Erev Rosh Hashana which
99
- // is technically in the previous Hebrew year
100
- // (but conveniently lets us get candle-lighting time for Erev)
101
- if (!theMonth && theYear > 1) {
102
- startAbs--;
103
- }
104
- return [startAbs, endAbs];
105
- }
@@ -1,6 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- /**
4
- * @private
5
- */
6
- export declare function hallel_(events: Event[], hdate: HDate): number;
@@ -1,39 +0,0 @@
1
- import { months } from '@hebcal/hdate';
2
- import { flags } from './event';
3
- import { holidayDesc as hdesc } from './staticHolidays';
4
- const NONE = 0;
5
- const HALF = 1;
6
- const WHOLE = 2;
7
- /**
8
- * @private
9
- */
10
- export function hallel_(events, hdate) {
11
- const abs = hdate.abs();
12
- for (const ev of events) {
13
- const hd = ev.getDate();
14
- if (hd.abs() !== abs) {
15
- continue;
16
- }
17
- const desc = ev.getDesc();
18
- const month = hd.getMonth();
19
- const mday = hd.getDate();
20
- const mask = ev.getFlags();
21
- if (desc.startsWith('Chanukah') ||
22
- desc.startsWith('Shavuot') ||
23
- desc.startsWith('Sukkot') ||
24
- (month === months.NISAN &&
25
- (mday === 15 || mday === 16) &&
26
- mask & flags.CHAG) || // Pesach
27
- desc === hdesc.YOM_HAATZMA_UT ||
28
- desc === hdesc.YOM_YERUSHALAYIM) {
29
- return WHOLE;
30
- }
31
- if (mask & flags.ROSH_CHODESH ||
32
- (desc.startsWith('Pesach') &&
33
- desc !== hdesc.PESACH_I &&
34
- desc !== hdesc.PESACH_II)) {
35
- return HALF;
36
- }
37
- }
38
- return NONE;
39
- }
@@ -1,28 +0,0 @@
1
- declare const _default: {
2
- headers: {
3
- "plural-forms": string;
4
- language: string;
5
- };
6
- contexts: {
7
- "": {
8
- Korach: string[];
9
- Chukat: string[];
10
- "Erev Yom Kippur": string[];
11
- "Yom Kippur": string[];
12
- "Yom Kippur Katan": string[];
13
- "Pesach Shabbat Chol ha-Moed": string[];
14
- "Sukkot Shabbat Chol ha-Moed": string[];
15
- "Erev Sukkot": string[];
16
- Sukkot: string[];
17
- "Sukkot I": string[];
18
- "Sukkot II": string[];
19
- "Sukkot II (CH''M)": string[];
20
- "Sukkot III (CH''M)": string[];
21
- "Sukkot IV (CH''M)": string[];
22
- "Sukkot V (CH''M)": string[];
23
- "Sukkot VI (CH''M)": string[];
24
- "Sukkot VII (Hoshana Raba)": string[];
25
- };
26
- };
27
- };
28
- export default _default;
@@ -1 +0,0 @@
1
- export default { "headers": { "plural-forms": "nplurals=2; plural=(n != 1);", "language": "he-x-NoNikud" }, "contexts": { "": { "Korach": ["קורח"], "Chukat": ["חוקת"], "Erev Yom Kippur": ["ערב יום כיפור"], "Yom Kippur": ["יום כיפור"], "Yom Kippur Katan": ["יום כיפור קטן"], "Pesach Shabbat Chol ha-Moed": ["פסח שבת חול המועד"], "Sukkot Shabbat Chol ha-Moed": ["סוכות שבת חול המועד"], "Erev Sukkot": ["ערב סוכות"], "Sukkot": ["סוכות"], "Sukkot I": ["סוכות א׳"], "Sukkot II": ["סוכות ב׳"], "Sukkot II (CH''M)": ["סוכות ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סוכות ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סוכות ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סוכות ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סוכות ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סוכות ז׳ (הושענא רבה)"] } } };