@hebcal/core 6.9.3 → 6.11.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 (89) hide show
  1. package/README.md +21 -12
  2. package/dist/bundle.js +1205 -1006
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +13 -13
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +35 -2
  7. package/dist/esm/DailyLearning.js +1 -1
  8. package/dist/esm/DailyLearning.js.map +1 -1
  9. package/dist/esm/HebrewDateEvent.js +1 -1
  10. package/dist/esm/HebrewDateEvent.js.map +1 -1
  11. package/dist/esm/HolidayEvent.js +3 -3
  12. package/dist/esm/HolidayEvent.js.map +1 -1
  13. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  14. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  15. package/dist/esm/ParshaEvent.js +1 -1
  16. package/dist/esm/ParshaEvent.js.map +1 -1
  17. package/dist/esm/TimedEvent.js +1 -1
  18. package/dist/esm/TimedEvent.js.map +1 -1
  19. package/dist/esm/YomKippurKatanEvent.js +1 -1
  20. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  21. package/dist/esm/ashkenazi.po.js +1 -1
  22. package/dist/esm/ashkenazi.po.js.map +1 -1
  23. package/dist/esm/calendar.d.ts +11 -3
  24. package/dist/esm/calendar.js +50 -15
  25. package/dist/esm/calendar.js.map +1 -1
  26. package/dist/esm/candles.d.ts +8 -5
  27. package/dist/esm/candles.js +58 -18
  28. package/dist/esm/candles.js.map +1 -1
  29. package/dist/esm/cities.json.js +1 -1
  30. package/dist/esm/cities.json.js.map +1 -1
  31. package/dist/esm/event.d.ts +47 -0
  32. package/dist/esm/event.js +63 -4
  33. package/dist/esm/event.js.map +1 -1
  34. package/dist/esm/getStartAndEnd.js +1 -1
  35. package/dist/esm/getStartAndEnd.js.map +1 -1
  36. package/dist/esm/hallel.js +3 -5
  37. package/dist/esm/hallel.js.map +1 -1
  38. package/dist/esm/he-x-NoNikud.po.js +1 -1
  39. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  40. package/dist/esm/he.po.js +1 -1
  41. package/dist/esm/he.po.js.map +1 -1
  42. package/dist/esm/hebcal.d.ts +2 -2
  43. package/dist/esm/hebcal.js +4 -5
  44. package/dist/esm/hebcal.js.map +1 -1
  45. package/dist/esm/holidays.js +2 -2
  46. package/dist/esm/holidays.js.map +1 -1
  47. package/dist/esm/index.d.ts +8 -8
  48. package/dist/esm/index.js +1 -1
  49. package/dist/esm/isAssurBemlacha.js +3 -5
  50. package/dist/esm/isAssurBemlacha.js.map +1 -1
  51. package/dist/esm/isAveilut.js +1 -1
  52. package/dist/esm/isAveilut.js.map +1 -1
  53. package/dist/esm/isFastDay.js +2 -8
  54. package/dist/esm/isFastDay.js.map +1 -1
  55. package/dist/esm/locale.js +1 -1
  56. package/dist/esm/location.js +1 -1
  57. package/dist/esm/location.js.map +1 -1
  58. package/dist/esm/modern.js +1 -1
  59. package/dist/esm/modern.js.map +1 -1
  60. package/dist/esm/molad.js +1 -1
  61. package/dist/esm/molad.js.map +1 -1
  62. package/dist/esm/moladBase.js +1 -1
  63. package/dist/esm/moladBase.js.map +1 -1
  64. package/dist/esm/moladDate.js +1 -1
  65. package/dist/esm/moladDate.js.map +1 -1
  66. package/dist/esm/omer.js +1 -1
  67. package/dist/esm/omer.js.map +1 -1
  68. package/dist/esm/parshaName.js +1 -1
  69. package/dist/esm/parshaName.js.map +1 -1
  70. package/dist/esm/parshaYear.js +1 -1
  71. package/dist/esm/parshaYear.js.map +1 -1
  72. package/dist/esm/pkgVersion.d.ts +1 -1
  73. package/dist/esm/pkgVersion.js +2 -2
  74. package/dist/esm/pkgVersion.js.map +1 -1
  75. package/dist/esm/reformatTimeStr.js +1 -1
  76. package/dist/esm/reformatTimeStr.js.map +1 -1
  77. package/dist/esm/sedra.js +1 -1
  78. package/dist/esm/sedra.js.map +1 -1
  79. package/dist/esm/sefira.json.js +1 -1
  80. package/dist/esm/sefira.json.js.map +1 -1
  81. package/dist/esm/staticHolidays.js +1 -1
  82. package/dist/esm/staticHolidays.js.map +1 -1
  83. package/dist/esm/string.js +1 -1
  84. package/dist/esm/string.js.map +1 -1
  85. package/dist/esm/tachanun.js +1 -1
  86. package/dist/esm/tachanun.js.map +1 -1
  87. package/dist/esm/zmanim.js +1 -1
  88. package/dist/esm/zmanim.js.map +1 -1
  89. package/package.json +10 -10
package/README.md CHANGED
@@ -63,15 +63,16 @@ detail — `HolidayEvent`, `ParshaEvent`, `OmerEvent`, `CandleLightingEvent` and
63
63
  `HavdalahEvent` (both `TimedEvent`s, carrying an `eventTime`), `MoladEvent`,
64
64
  `HebrewDateEvent`, and others.
65
65
 
66
- Rather than testing `instanceof`, classify events with `flags`:
66
+ Rather than testing `instanceof`, classify events by their [`flags`](https://hebcal.github.io/api/core/variables/flags.html)
67
+ using `hasFlag()` (or `flagNames()` to list them all):
67
68
 
68
69
  ```javascript
69
- import {calendar, flags} from '@hebcal/core';
70
+ import {calendar} from '@hebcal/core';
70
71
 
71
72
  const events = calendar({year: 5784, isHebrewYear: true});
72
73
 
73
74
  for (const ev of events) {
74
- if (ev.getFlags() & flags.MAJOR_FAST) {
75
+ if (ev.hasFlag('MAJOR_FAST')) {
75
76
  console.log('fast day:', ev.render('en'));
76
77
  }
77
78
  }
@@ -133,7 +134,7 @@ Import `@hebcal/learning` once for its side effects, then request calendars thro
133
134
 
134
135
  ```javascript
135
136
  import '@hebcal/learning';
136
- import {calendar, flags} from '@hebcal/core';
137
+ import {calendar} from '@hebcal/core';
137
138
 
138
139
  const events = calendar({
139
140
  year: 5784,
@@ -143,7 +144,7 @@ const events = calendar({
143
144
  });
144
145
 
145
146
  for (const ev of events) {
146
- if (ev.getFlags() & flags.DAF_YOMI) {
147
+ if (ev.hasFlag('DAF_YOMI')) {
147
148
  console.log(ev.getDate().toString(), ev.render('en'));
148
149
  }
149
150
  }
@@ -186,7 +187,7 @@ and note that coordinates above the Arctic or below the Antarctic circle are
186
187
  guaranteed to be wrong.
187
188
 
188
189
  ```javascript
189
- import {calendar, Location, flags} from '@hebcal/core';
190
+ import {calendar, Location} from '@hebcal/core';
190
191
 
191
192
  const events = calendar({
192
193
  year: 2024,
@@ -195,7 +196,7 @@ const events = calendar({
195
196
  });
196
197
 
197
198
  for (const ev of events) {
198
- if (ev.getFlags() & flags.LIGHT_CANDLES) {
199
+ if (ev.hasFlag('LIGHT_CANDLES')) {
199
200
  console.log(ev.getDate().toString(), ev.eventTimeStr); // '24 Tevet 5784' '16:08'
200
201
  }
201
202
  }
@@ -215,13 +216,21 @@ visible — calculated at 8.5° of solar depression. Two mutually exclusive over
215
216
 
216
217
  **Minor fasts** begin at Alot HaShachar (16.1° in the morning). They end at 7.083°
217
218
  in the Diaspora, or 15 minutes after sunset in Israel (Rabbi Deblitzky's practice).
218
- Override with `options.fastEndDeg` or `options.fastEndMins` — again mutually
219
- exclusive. When a minor fast falls on a Friday, the end time is suppressed, because
219
+ Each end has a pair of mutually exclusive overrides:
220
+
221
+ - `options.fastStartDeg` — a different solar depression angle for the start, or
222
+ `options.fastStartMins` — a fixed number of minutes before sunrise (72 and 90
223
+ are typical).
224
+ - `options.fastEndDeg` — a different solar depression angle for the end, or
225
+ `options.fastEndMins` — a fixed number of minutes after sunset.
226
+
227
+ When a minor fast falls on a Friday, the end time is suppressed, because
220
228
  Shabbat begins before nightfall.
221
229
 
222
- **Tish'a B'Av** does not follow those rules: it begins at sunset the previous day and
223
- always ends at 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `fastEndDeg` and
224
- `fastEndMins`.
230
+ **Tish'a B'Av** does not follow those rules: it always begins at sunset the
231
+ previous day, and by default ends at 6.45° (Rabbi Yechiel Michel Tucazinsky),
232
+ ignoring the minor fast options. Override its end with `options.tishaBavEndDeg` or
233
+ `options.tishaBavEndMins` (mutually exclusive).
225
234
 
226
235
  **Chanukah** candle-lighting, also generated when `candlelighting` and `location`
227
236
  are set, is at Bein HaShmashos (13.5 minutes before 7.083°) on weekdays, regular