@hebcal/core 6.5.0 → 6.5.2

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 (136) hide show
  1. package/dist/bundle.js +5983 -5473
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +17 -17
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/CalOptions.d.ts +7 -4
  6. package/dist/esm/DailyLearning.d.ts +44 -7
  7. package/dist/esm/DailyLearning.js +45 -8
  8. package/dist/esm/DailyLearning.js.map +1 -1
  9. package/dist/esm/HebrewDateEvent.js +1 -1
  10. package/dist/esm/HolidayEvent.d.ts +34 -1
  11. package/dist/esm/HolidayEvent.js +35 -2
  12. package/dist/esm/HolidayEvent.js.map +1 -1
  13. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  14. package/dist/esm/ParshaEvent.js +1 -1
  15. package/dist/esm/TimedEvent.d.ts +32 -3
  16. package/dist/esm/TimedEvent.js +33 -4
  17. package/dist/esm/TimedEvent.js.map +1 -1
  18. package/dist/esm/YomKippurKatanEvent.js +1 -1
  19. package/dist/esm/ashkenazi.po.d.ts +1 -0
  20. package/dist/esm/ashkenazi.po.js +2 -2
  21. package/dist/esm/ashkenazi.po.js.map +1 -1
  22. package/dist/esm/calendar.d.ts +1 -0
  23. package/dist/esm/calendar.js +12 -2
  24. package/dist/esm/calendar.js.map +1 -1
  25. package/dist/esm/candles.d.ts +14 -1
  26. package/dist/esm/candles.js +15 -2
  27. package/dist/esm/candles.js.map +1 -1
  28. package/dist/esm/cities.json.js +5 -0
  29. package/dist/esm/cities.json.js.map +1 -0
  30. package/dist/esm/event.d.ts +58 -13
  31. package/dist/esm/event.js +59 -14
  32. package/dist/esm/event.js.map +1 -1
  33. package/dist/esm/getStartAndEnd.js +10 -2
  34. package/dist/esm/getStartAndEnd.js.map +1 -1
  35. package/dist/esm/hallel.js +20 -28
  36. package/dist/esm/hallel.js.map +1 -1
  37. package/dist/esm/he-x-NoNikud.po.js +1 -1
  38. package/dist/esm/he.po.d.ts +1 -0
  39. package/dist/esm/he.po.js +2 -2
  40. package/dist/esm/he.po.js.map +1 -1
  41. package/dist/esm/hebcal.d.ts +97 -19
  42. package/dist/esm/hebcal.js +102 -21
  43. package/dist/esm/hebcal.js.map +1 -1
  44. package/dist/esm/holidays.d.ts +21 -2
  45. package/dist/esm/holidays.js +39 -3
  46. package/dist/esm/holidays.js.map +1 -1
  47. package/dist/esm/index.d.ts +1 -1
  48. package/dist/esm/index.js +2 -1
  49. package/dist/esm/index.js.map +1 -1
  50. package/dist/esm/isAssurBemlacha.d.ts +24 -4
  51. package/dist/esm/isAssurBemlacha.js +25 -5
  52. package/dist/esm/isAssurBemlacha.js.map +1 -1
  53. package/dist/esm/isAveilut.d.ts +14 -3
  54. package/dist/esm/isAveilut.js +15 -4
  55. package/dist/esm/isAveilut.js.map +1 -1
  56. package/dist/esm/isFastDay.d.ts +13 -1
  57. package/dist/esm/isFastDay.js +14 -2
  58. package/dist/esm/isFastDay.js.map +1 -1
  59. package/dist/esm/locale.js +1 -1
  60. package/dist/esm/location.d.ts +96 -8
  61. package/dist/esm/location.js +112 -88
  62. package/dist/esm/location.js.map +1 -1
  63. package/dist/esm/modern.js +1 -1
  64. package/dist/esm/molad.d.ts +39 -7
  65. package/dist/esm/molad.js +40 -8
  66. package/dist/esm/molad.js.map +1 -1
  67. package/dist/esm/moladBase.js +1 -1
  68. package/dist/esm/moladDate.js +1 -1
  69. package/dist/esm/omer.d.ts +32 -4
  70. package/dist/esm/omer.js +33 -5
  71. package/dist/esm/omer.js.map +1 -1
  72. package/dist/esm/parshaName.js +1 -1
  73. package/dist/esm/parshaYear.d.ts +12 -1
  74. package/dist/esm/parshaYear.js +13 -2
  75. package/dist/esm/parshaYear.js.map +1 -1
  76. package/dist/esm/pkgVersion.d.ts +1 -1
  77. package/dist/esm/pkgVersion.js +2 -2
  78. package/dist/esm/pkgVersion.js.map +1 -1
  79. package/dist/esm/reformatTimeStr.js +1 -1
  80. package/dist/esm/sedra.d.ts +94 -14
  81. package/dist/esm/sedra.js +95 -15
  82. package/dist/esm/sedra.js.map +1 -1
  83. package/dist/esm/sefira.json.js +1 -1
  84. package/dist/esm/staticHolidays.d.ts +2 -0
  85. package/dist/esm/staticHolidays.js +3 -1
  86. package/dist/esm/staticHolidays.js.map +1 -1
  87. package/dist/esm/tachanun.js +1 -1
  88. package/dist/esm/temporal-shim.js +1 -1
  89. package/dist/esm/zmanim.js +1 -1
  90. package/dist/src/CalOptions.d.ts +7 -4
  91. package/dist/src/DailyLearning.d.ts +44 -7
  92. package/dist/src/DailyLearning.js +44 -7
  93. package/dist/src/HolidayEvent.d.ts +34 -1
  94. package/dist/src/HolidayEvent.js +34 -1
  95. package/dist/src/TimedEvent.d.ts +32 -3
  96. package/dist/src/TimedEvent.js +32 -3
  97. package/dist/src/ashkenazi.po.d.ts +1 -0
  98. package/dist/src/ashkenazi.po.js +1 -1
  99. package/dist/src/calendar.d.ts +1 -0
  100. package/dist/src/calendar.js +11 -1
  101. package/dist/src/candles.d.ts +14 -1
  102. package/dist/src/candles.js +14 -1
  103. package/dist/src/cities.json +67 -0
  104. package/dist/src/event.d.ts +58 -13
  105. package/dist/src/event.js +58 -13
  106. package/dist/src/getStartAndEnd.js +9 -1
  107. package/dist/src/hallel.js +19 -27
  108. package/dist/src/he.po.d.ts +1 -0
  109. package/dist/src/he.po.js +1 -1
  110. package/dist/src/hebcal.d.ts +97 -19
  111. package/dist/src/hebcal.js +101 -20
  112. package/dist/src/holidays.d.ts +21 -2
  113. package/dist/src/holidays.js +38 -2
  114. package/dist/src/index.d.ts +1 -1
  115. package/dist/src/index.js +1 -0
  116. package/dist/src/isAssurBemlacha.d.ts +24 -4
  117. package/dist/src/isAssurBemlacha.js +24 -4
  118. package/dist/src/isAveilut.d.ts +14 -3
  119. package/dist/src/isAveilut.js +14 -3
  120. package/dist/src/isFastDay.d.ts +13 -1
  121. package/dist/src/isFastDay.js +13 -1
  122. package/dist/src/location.d.ts +96 -8
  123. package/dist/src/location.js +111 -87
  124. package/dist/src/molad.d.ts +39 -7
  125. package/dist/src/molad.js +39 -7
  126. package/dist/src/omer.d.ts +32 -4
  127. package/dist/src/omer.js +32 -4
  128. package/dist/src/parshaYear.d.ts +12 -1
  129. package/dist/src/parshaYear.js +12 -1
  130. package/dist/src/pkgVersion.d.ts +1 -1
  131. package/dist/src/pkgVersion.js +1 -1
  132. package/dist/src/sedra.d.ts +94 -14
  133. package/dist/src/sedra.js +94 -14
  134. package/dist/src/staticHolidays.d.ts +2 -0
  135. package/dist/src/staticHolidays.js +2 -0
  136. package/package.json +6 -6
@@ -1,32 +1,69 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { Event } from './event';
3
3
  /**
4
- * Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.
4
+ * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
5
+ * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
5
6
  *
6
- * Learning schedules are provided by the `@hebcal/learning` package.
7
+ * `@hebcal/core` itself contains no learning schedules they are provided
8
+ * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
9
+ * package, which calls {@link DailyLearning.addCalendar} on import. After
10
+ * `@hebcal/learning` is loaded, `HebrewCalendar.calendar()` will emit
11
+ * learning events when the corresponding `options.dailyLearning` flag is set.
12
+ *
13
+ * @example
14
+ * import '@hebcal/learning';
15
+ * import {DailyLearning, HDate} from '@hebcal/core';
16
+ *
17
+ * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
18
+ * console.log(ev?.render('en')); // e.g. 'Berakhot 2'
7
19
  */
8
20
  export declare class DailyLearning {
9
21
  /**
10
- * Register a new learning calendar.
22
+ * Registers a new learning calendar.
23
+ *
24
+ * The provided function is called whenever a caller asks for an event
25
+ * from this calendar; if no learning occurs that day (e.g. the date is
26
+ * before the cycle's start) it should return `null`.
27
+ * @example
28
+ * DailyLearning.addCalendar(
29
+ * 'myCalendar',
30
+ * (hd, il) => new Event(hd, 'Today\'s learning', 0),
31
+ * new HDate(1, 'Tishrei', 5780),
32
+ * );
11
33
  * @param name case insensitive
12
34
  * @param calendar a function that returns an `Event` or `null`
13
35
  * @param startDate the first date for which this calendar is valid
14
36
  */
15
37
  static addCalendar(name: string, calendar: (hd: HDate, il: boolean) => Event | null, startDate?: HDate): void;
16
38
  /**
17
- * Returns an event from daily calendar for a given date. Returns `null` if there
18
- * is no learning from this calendar on this date.
39
+ * Returns the learning event for the given date from the named calendar,
40
+ * or `null` if there is no learning that day (or the named calendar is
41
+ * not registered).
42
+ * @example
43
+ * import '@hebcal/learning';
44
+ * import {DailyLearning, HDate} from '@hebcal/core';
45
+ * DailyLearning.lookup('dafYomi', new HDate(2024, 1, 15), false);
19
46
  * @param name case insensitive
20
47
  * @param hd Hebrew Date
21
48
  * @param il true for Israel, false for Diaspora
22
49
  */
23
50
  static lookup(name: string, hd: HDate, il: boolean): Event | null;
51
+ /**
52
+ * Returns the first Hebrew date for which the named learning calendar
53
+ * is valid (as registered by {@link addCalendar}), or `undefined` if the
54
+ * calendar was not registered with a start date or is not registered at all.
55
+ * @param name case insensitive
56
+ */
24
57
  static getStartDate(name: string): HDate | undefined;
25
58
  /**
26
- * Tests to see if learning calendar has been registered
59
+ * Returns `true` if a learning calendar with the given name has been
60
+ * registered via {@link addCalendar}.
27
61
  * @param name case insensitive
28
62
  */
29
63
  static has(name: string): boolean;
30
- /** Returns the names of all calendars registered */
64
+ /**
65
+ * Returns the (lower-cased) names of all currently-registered learning
66
+ * calendars.
67
+ */
31
68
  static getCalendars(): string[];
32
69
  }
@@ -1,12 +1,34 @@
1
1
  const cals = new Map();
2
2
  /**
3
- * Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.
3
+ * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
4
+ * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
4
5
  *
5
- * Learning schedules are provided by the `@hebcal/learning` package.
6
+ * `@hebcal/core` itself contains no learning schedules they are provided
7
+ * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
8
+ * package, which calls {@link DailyLearning.addCalendar} on import. After
9
+ * `@hebcal/learning` is loaded, `HebrewCalendar.calendar()` will emit
10
+ * learning events when the corresponding `options.dailyLearning` flag is set.
11
+ *
12
+ * @example
13
+ * import '@hebcal/learning';
14
+ * import {DailyLearning, HDate} from '@hebcal/core';
15
+ *
16
+ * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
17
+ * console.log(ev?.render('en')); // e.g. 'Berakhot 2'
6
18
  */
7
19
  export class DailyLearning {
8
20
  /**
9
- * Register a new learning calendar.
21
+ * Registers a new learning calendar.
22
+ *
23
+ * The provided function is called whenever a caller asks for an event
24
+ * from this calendar; if no learning occurs that day (e.g. the date is
25
+ * before the cycle's start) it should return `null`.
26
+ * @example
27
+ * DailyLearning.addCalendar(
28
+ * 'myCalendar',
29
+ * (hd, il) => new Event(hd, 'Today\'s learning', 0),
30
+ * new HDate(1, 'Tishrei', 5780),
31
+ * );
10
32
  * @param name case insensitive
11
33
  * @param calendar a function that returns an `Event` or `null`
12
34
  * @param startDate the first date for which this calendar is valid
@@ -21,8 +43,13 @@ export class DailyLearning {
21
43
  });
22
44
  }
23
45
  /**
24
- * Returns an event from daily calendar for a given date. Returns `null` if there
25
- * is no learning from this calendar on this date.
46
+ * Returns the learning event for the given date from the named calendar,
47
+ * or `null` if there is no learning that day (or the named calendar is
48
+ * not registered).
49
+ * @example
50
+ * import '@hebcal/learning';
51
+ * import {DailyLearning, HDate} from '@hebcal/core';
52
+ * DailyLearning.lookup('dafYomi', new HDate(2024, 1, 15), false);
26
53
  * @param name case insensitive
27
54
  * @param hd Hebrew Date
28
55
  * @param il true for Israel, false for Diaspora
@@ -34,6 +61,12 @@ export class DailyLearning {
34
61
  }
35
62
  return null;
36
63
  }
64
+ /**
65
+ * Returns the first Hebrew date for which the named learning calendar
66
+ * is valid (as registered by {@link addCalendar}), or `undefined` if the
67
+ * calendar was not registered with a start date or is not registered at all.
68
+ * @param name case insensitive
69
+ */
37
70
  static getStartDate(name) {
38
71
  const cal = cals.get(name.toLowerCase());
39
72
  if (typeof cal === 'object') {
@@ -42,13 +75,17 @@ export class DailyLearning {
42
75
  return undefined;
43
76
  }
44
77
  /**
45
- * Tests to see if learning calendar has been registered
78
+ * Returns `true` if a learning calendar with the given name has been
79
+ * registered via {@link addCalendar}.
46
80
  * @param name case insensitive
47
81
  */
48
82
  static has(name) {
49
83
  return cals.has(name.toLowerCase());
50
84
  }
51
- /** Returns the names of all calendars registered */
85
+ /**
86
+ * Returns the (lower-cased) names of all currently-registered learning
87
+ * calendars.
88
+ */
52
89
  static getCalendars() {
53
90
  return Array.from(cals.keys());
54
91
  }
@@ -1,7 +1,22 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { Event } from './event';
3
3
  import './locale';
4
- /** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
4
+ /**
5
+ * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.
6
+ *
7
+ * Most holiday-related events emitted by {@link HebrewCalendar.calendar}
8
+ * are instances of `HolidayEvent` or one of its subclasses
9
+ * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},
10
+ * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).
11
+ *
12
+ * Adds two notable behaviors over the base {@link Event}:
13
+ *
14
+ * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,
15
+ * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `"Erev Pesach"` →
16
+ * `"Pesach"`).
17
+ * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`
18
+ * link for the holiday.
19
+ */
5
20
  export declare class HolidayEvent extends Event {
6
21
  /** During Sukkot or Pesach */
7
22
  cholHaMoedDay?: number;
@@ -12,7 +27,25 @@ export declare class HolidayEvent extends Event {
12
27
  */
13
28
  observed?: boolean;
14
29
  constructor(date: HDate, desc: string, mask?: number, attrs?: object);
30
+ /**
31
+ * Returns a simplified (untranslated) name for this holiday, stripping
32
+ * qualifiers so that related events group under one name.
33
+ *
34
+ * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,
35
+ * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,
36
+ * `: 8th Day`, and a leading `"Erev "`.
37
+ * @example
38
+ * // 'Erev Pesach' => 'Pesach'
39
+ * // 'Sukkot III (CH''M)' => 'Sukkot'
40
+ * // 'Chanukah: 5 Candles' => 'Chanukah'
41
+ * // 'Rosh Hashana 5784' => 'Rosh Hashana'
42
+ */
15
43
  basename(): string;
44
+ /**
45
+ * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on
46
+ * this holiday. Israel-only holidays get an `?i=on` query parameter.
47
+ * Returns `undefined` for years outside `[100, 2999]`.
48
+ */
16
49
  url(): string | undefined;
17
50
  urlDateSuffix(): string;
18
51
  getEmoji(): string;
@@ -2,7 +2,22 @@ import { Locale, isoDateString } from '@hebcal/hdate';
2
2
  import { Event, flags } from './event';
3
3
  import { holidayDesc as hdesc } from './staticHolidays';
4
4
  import './locale'; // Adds Hebrew and Ashkenazic translations
5
- /** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
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
+ */
6
21
  export class HolidayEvent extends Event {
7
22
  /** During Sukkot or Pesach */
8
23
  cholHaMoedDay;
@@ -18,6 +33,19 @@ export class HolidayEvent extends Event {
18
33
  Object.assign(this, attrs);
19
34
  }
20
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
+ */
21
49
  basename() {
22
50
  return this.getDesc()
23
51
  .replace(/ \d{4}$/, '')
@@ -29,6 +57,11 @@ export class HolidayEvent extends Event {
29
57
  .replace(/: 8th Day$/, '')
30
58
  .replace(/^Erev /, '');
31
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
+ */
32
65
  url() {
33
66
  const year = this.greg().getFullYear();
34
67
  if (year < 100 || year > 2999) {
@@ -3,12 +3,26 @@ import { CalOptions } from './CalOptions';
3
3
  import { Location } from './location';
4
4
  import { Event } from './event';
5
5
  import './locale';
6
- /** An event that has an `eventTime` and `eventTimeStr` */
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
+ */
7
16
  export declare class TimedEvent extends Event {
17
+ /** The exact moment of the event, rounded to the nearest minute */
8
18
  readonly eventTime: Date;
19
+ /** Geographic location used to compute `eventTime` */
9
20
  readonly location: Location;
21
+ /** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
10
22
  readonly eventTimeStr: string;
23
+ /** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
11
24
  readonly fmtTime: string;
25
+ /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
12
26
  readonly linkedEvent?: Event;
13
27
  /**
14
28
  * @param desc Description (not translated)
@@ -25,12 +39,27 @@ export declare class TimedEvent extends Event {
25
39
  renderBrief(locale?: string): string;
26
40
  getCategories(): string[];
27
41
  }
28
- /** Candle lighting before Shabbat or holiday */
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
+ */
29
50
  export declare class CandleLightingEvent extends TimedEvent {
30
51
  constructor(date: HDate, mask: number, eventTime: Date, location: Location, linkedEvent?: Event, options?: CalOptions);
31
52
  getEmoji(): string;
32
53
  }
33
- /** Havdalah after Shabbat or holiday */
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
+ */
34
63
  export declare class HavdalahEvent extends TimedEvent {
35
64
  private readonly havdalahMins?;
36
65
  constructor(date: HDate, mask: number, eventTime: Date, location: Location, havdalahMins?: number, linkedEvent?: Event, options?: CalOptions);
@@ -6,12 +6,26 @@ import { holidayDesc as hdesc } from './staticHolidays';
6
6
  import './locale'; // Adds Hebrew and Ashkenazic translations
7
7
  const HAVDALAH = hdesc.HAVDALAH;
8
8
  const CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;
9
- /** An event that has an `eventTime` and `eventTimeStr` */
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
+ */
10
19
  export class TimedEvent extends Event {
20
+ /** The exact moment of the event, rounded to the nearest minute */
11
21
  eventTime;
22
+ /** Geographic location used to compute `eventTime` */
12
23
  location;
24
+ /** 24-hour formatted time string in the location's timezone (e.g. `"19:42"`) */
13
25
  eventTimeStr;
26
+ /** Locale-aware formatted time string (e.g. `"7:42pm"` in US locale) */
14
27
  fmtTime;
28
+ /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */
15
29
  linkedEvent;
16
30
  /**
17
31
  * @param desc Description (not translated)
@@ -63,7 +77,14 @@ export class TimedEvent extends Event {
63
77
  return ['unknown'];
64
78
  }
65
79
  }
66
- /** Candle lighting before Shabbat or holiday */
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
+ */
67
88
  export class CandleLightingEvent extends TimedEvent {
68
89
  constructor(date, mask, eventTime, location, linkedEvent, options) {
69
90
  super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);
@@ -72,7 +93,15 @@ export class CandleLightingEvent extends TimedEvent {
72
93
  return '🕯️';
73
94
  }
74
95
  }
75
- /** Havdalah after Shabbat or holiday */
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
+ */
76
105
  export class HavdalahEvent extends TimedEvent {
77
106
  havdalahMins;
78
107
  constructor(date, mask, eventTime, location, havdalahMins, linkedEvent, options) {
@@ -44,6 +44,7 @@ declare const _default: {
44
44
  "Sukkot VII (Hoshana Raba)": string[];
45
45
  "Sukkot Shabbat Chol ha-Moed": string[];
46
46
  "Ta'anit Bechorot": string[];
47
+ "Ta'anit BeHaB": string[];
47
48
  "Ta'anit Esther": string[];
48
49
  Toldot: string[];
49
50
  Vaetchanan: string[];
@@ -1 +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"], "Birkat Hachamah": ["Birkas HaChamah"], "Birkat HaChamah": ["Birkas HaChamah"], "Shushan Purim Katan": ["Shushan Purim Koton"], "Alot HaShachar": ["Alos HaShachar"], "Misheyakir": ["Misheyakir"], "Misheyakir Machmir": ["Misheyakir Machmir"], "Sunrise": ["Sunrise"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Kriat Shema, sof zeman (GRA)": ["Krias Shema, sof zman (GRA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Tefilah, sof zeman (GRA)": ["Tefilah, sof zman (GRA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot HaYom": ["Chatzos"], "Chatzot hayom": ["Chatzos"], "Mincha Gedolah": ["Mincha Gedolah"], "Mincha Ketanah": ["Mincha Ketanah"], "Plag HaMincha": ["Plag HaMincha"], "Sunset": ["Sunset"], "Bein HaShemashot": ["Bein HaShemashos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"] } } };
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 BeHaB": ["Ta’anis BeHaB"], "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"], "Birkat Hachamah": ["Birkas HaChamah"], "Birkat HaChamah": ["Birkas HaChamah"], "Shushan Purim Katan": ["Shushan Purim Koton"], "Alot HaShachar": ["Alos HaShachar"], "Misheyakir": ["Misheyakir"], "Misheyakir Machmir": ["Misheyakir Machmir"], "Sunrise": ["Sunrise"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Kriat Shema, sof zeman (GRA)": ["Krias Shema, sof zman (GRA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Tefilah, sof zeman (GRA)": ["Tefilah, sof zman (GRA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot HaYom": ["Chatzos"], "Chatzot hayom": ["Chatzos"], "Mincha Gedolah": ["Mincha Gedolah"], "Mincha Ketanah": ["Mincha Ketanah"], "Plag HaMincha": ["Plag HaMincha"], "Sunset": ["Sunset"], "Bein HaShemashot": ["Bein HaShemashos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"] } } };
@@ -34,6 +34,7 @@ import { Event } from './event';
34
34
  * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
35
35
  * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
36
36
  * * Yom Kippur Katan (`options.yomKippurKatan`)
37
+ * * BeHaB fast days after Pesach and Sukkot (`options.behab`)
37
38
  * * Yizkor (`options.yizkor`)
38
39
  *
39
40
  * Daily Study of texts are supported by the
@@ -49,6 +49,7 @@ import { holidayDesc as hdesc } from './staticHolidays';
49
49
  * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
50
50
  * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
51
51
  * * Yom Kippur Katan (`options.yomKippurKatan`)
52
+ * * BeHaB fast days after Pesach and Sukkot (`options.behab`)
52
53
  * * Yizkor (`options.yizkor`)
53
54
  *
54
55
  * Daily Study of texts are supported by the
@@ -297,6 +298,7 @@ const EREV = flags.EREV;
297
298
  const CHOL_HAMOED = flags.CHOL_HAMOED;
298
299
  const YOM_KIPPUR_KATAN = flags.YOM_KIPPUR_KATAN;
299
300
  const YIZKOR = flags.YIZKOR;
301
+ const BEHAB = flags.BEHAB;
300
302
  const unrecognizedAlreadyWarned = new Set();
301
303
  const RECOGNIZED_OPTIONS = {
302
304
  location: 1,
@@ -327,6 +329,7 @@ const RECOGNIZED_OPTIONS = {
327
329
  addHebrewDatesForEvents: 1,
328
330
  mask: 1,
329
331
  yomKippurKatan: 1,
332
+ behab: 1,
330
333
  hour12: 1,
331
334
  dailyLearning: 1,
332
335
  useElevation: 1,
@@ -499,6 +502,9 @@ function getMaskFromOptions(options) {
499
502
  if (options.yomKippurKatan) {
500
503
  mask |= YOM_KIPPUR_KATAN;
501
504
  }
505
+ if (options.behab) {
506
+ mask |= BEHAB;
507
+ }
502
508
  if (options.yizkor) {
503
509
  mask |= YIZKOR;
504
510
  }
@@ -557,6 +563,8 @@ function setOptionsFromMask(options) {
557
563
  options.shabbatMevarchim = true;
558
564
  if (m & YOM_KIPPUR_KATAN)
559
565
  options.yomKippurKatan = true;
566
+ if (m & BEHAB)
567
+ options.behab = true;
560
568
  if (m & YIZKOR)
561
569
  options.yizkor = true;
562
570
  return m;
@@ -573,6 +581,7 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
573
581
  }
574
582
  const eFlags = ev.getFlags();
575
583
  if ((!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||
584
+ (!options.behab && eFlags & BEHAB) ||
576
585
  (options.noModern && eFlags & MODERN_HOLIDAY)) {
577
586
  return candlesEv; // bail out early
578
587
  }
@@ -613,7 +622,8 @@ function appendHolidayAndRelated(candlesEv, events, ev, options, isFriday, isSat
613
622
  }
614
623
  }
615
624
  if (!options.noHolidays ||
616
- (options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN)) {
625
+ (options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||
626
+ (options.behab && eFlags & BEHAB)) {
617
627
  events.push(ev); // the original event itself
618
628
  }
619
629
  }
@@ -8,7 +8,20 @@ import { TimedEvent } from './TimedEvent';
8
8
  * @private
9
9
  */
10
10
  export declare function makeCandleEvent(ev: Event | undefined, hd: HDate, options: CalOptions, isFriday: boolean, isSaturday: boolean): TimedEvent | undefined;
11
- /** A fast day also contains a start and end time */
11
+ /**
12
+ * A fast day holiday with attached start and end time events.
13
+ *
14
+ * Wraps an underlying fast-day {@link HolidayEvent} and (when computable
15
+ * for the given location) exposes a "Fast begins" and "Fast ends"
16
+ * {@link TimedEvent}. Generated by {@link HebrewCalendar.calendar} when
17
+ * `options.candlelighting` is `true` and `options.location` is provided.
18
+ *
19
+ * - Minor fasts begin at *Alot HaShachar* (16.1° below horizon in the morning)
20
+ * and end at tzeit (7.083° by default — overridable via `options.fastEndDeg`).
21
+ * - Tish'a B'Av begins at sunset on the previous day and ends at tzeit.
22
+ * - When a minor fast falls on a Friday, the end time is suppressed
23
+ * (Shabbat begins before nightfall).
24
+ */
12
25
  export declare class FastDayEvent extends HolidayEvent {
13
26
  /** original event */
14
27
  readonly linkedEvent: HolidayEvent;
@@ -52,7 +52,20 @@ export function makeCandleEvent(ev, hd, options, isFriday, isSaturday) {
52
52
  }
53
53
  const FAST_BEGINS = hdesc.FAST_BEGINS;
54
54
  const FAST_ENDS = hdesc.FAST_ENDS;
55
- /** A fast day also contains a start and end time */
55
+ /**
56
+ * A fast day holiday with attached start and end time events.
57
+ *
58
+ * Wraps an underlying fast-day {@link HolidayEvent} and (when computable
59
+ * for the given location) exposes a "Fast begins" and "Fast ends"
60
+ * {@link TimedEvent}. Generated by {@link HebrewCalendar.calendar} when
61
+ * `options.candlelighting` is `true` and `options.location` is provided.
62
+ *
63
+ * - Minor fasts begin at *Alot HaShachar* (16.1° below horizon in the morning)
64
+ * and end at tzeit (7.083° by default — overridable via `options.fastEndDeg`).
65
+ * - Tish'a B'Av begins at sunset on the previous day and ends at tzeit.
66
+ * - When a minor fast falls on a Friday, the end time is suppressed
67
+ * (Shabbat begins before nightfall).
68
+ */
56
69
  export class FastDayEvent extends HolidayEvent {
57
70
  /** original event */
58
71
  linkedEvent;
@@ -0,0 +1,67 @@
1
+ [
2
+ "Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27",
3
+ "Atlanta|US|33.749|-84.38798|America/New_York|336",
4
+ "Austin|US|30.26715|-97.74306|America/Chicago|165",
5
+ "Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41",
6
+ "Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285",
7
+ "Berlin|DE|52.52437|13.41053|Europe/Berlin|43",
8
+ "Baltimore|US|39.29038|-76.61219|America/New_York|35",
9
+ "Bogota|CO|4.60971|-74.08175|America/Bogota|2582",
10
+ "Boston|US|42.35843|-71.05977|America/New_York|38",
11
+ "Budapest|HU|47.49801|19.03991|Europe/Budapest|104",
12
+ "Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31",
13
+ "Buffalo|US|42.88645|-78.87837|America/New_York|191",
14
+ "Chicago|US|41.85003|-87.65005|America/Chicago|180",
15
+ "Cincinnati|US|39.162|-84.45689|America/New_York|267",
16
+ "Cleveland|US|41.4995|-81.69541|America/New_York|204",
17
+ "Dallas|US|32.78306|-96.80667|America/Chicago|139",
18
+ "Denver|US|39.73915|-104.9847|America/Denver|1636",
19
+ "Detroit|US|42.33143|-83.04575|America/Detroit|192",
20
+ "Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63",
21
+ "Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11",
22
+ "Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40",
23
+ "Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18",
24
+ "Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26",
25
+ "Houston|US|29.76328|-95.36327|America/Chicago|30",
26
+ "Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786",
27
+ "Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767",
28
+ "Kiev|UA|50.45466|30.5238|Europe/Kiev|187",
29
+ "La Paz|BO|-16.5|-68.15|America/La_Paz|3782",
30
+ "Livingston|US|40.79593|-74.31487|America/New_York|98",
31
+ "Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613",
32
+ "London|GB|51.50853|-0.12574|Europe/London|25",
33
+ "Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96",
34
+ "Marseilles|FR|43.29695|5.38107|Europe/Paris|28",
35
+ "Miami|US|25.77427|-80.19366|America/New_York|25",
36
+ "Minneapolis|US|44.97997|-93.26384|America/Chicago|262",
37
+ "Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25",
38
+ "Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240",
39
+ "Montreal|CA|45.50884|-73.58781|America/Toronto|216",
40
+ "Moscow|RU|55.75222|37.61556|Europe/Moscow|144",
41
+ "New York|US|40.71427|-74.00597|America/New_York|57",
42
+ "Omaha|US|41.25861|-95.93779|America/Chicago|315",
43
+ "Ottawa|CA|45.41117|-75.69812|America/Toronto|71",
44
+ "Panama City|PA|8.9936|-79.51973|America/Panama|17",
45
+ "Paris|FR|48.85341|2.3488|Europe/Paris|42",
46
+ "Pawtucket|US|41.87871|-71.38256|America/New_York|0",
47
+ "Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54",
48
+ "Philadelphia|US|39.95233|-75.16379|America/New_York|8",
49
+ "Phoenix|US|33.44838|-112.07404|America/Phoenix|366",
50
+ "Pittsburgh|US|40.44062|-79.99589|America/New_York|239",
51
+ "Providence|US|41.82399|-71.41283|America/New_York|0",
52
+ "Portland|US|45.52345|-122.67621|America/Los_Angeles|15",
53
+ "Saint Louis|US|38.62727|-90.19789|America/Chicago|149",
54
+ "Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11",
55
+ "San Diego|US|32.71533|-117.15726|America/Los_Angeles|20",
56
+ "San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28",
57
+ "Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769",
58
+ "Seattle|US|47.60621|-122.33207|America/Los_Angeles|56",
59
+ "Sydney|AU|-33.86785|151.20732|Australia/Sydney|58",
60
+ "Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15",
61
+ "Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0",
62
+ "Toronto|CA|43.70011|-79.4163|America/Toronto|175",
63
+ "Vancouver|CA|49.24966|-123.11934|America/Vancouver|70",
64
+ "White Plains|US|41.03399|-73.76291|America/New_York|82",
65
+ "Washington DC|US|38.89511|-77.03637|America/New_York|6",
66
+ "Worcester|US|42.26259|-71.80229|America/New_York|164"
67
+ ]