@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
@@ -1,171 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import type { Location } from './location';
3
- export type DailyLearningValue = boolean | number | string;
4
- /**
5
- * Options to configure which events are returned
6
- */
7
- export type CalOptions = {
8
- /**
9
- * latitude/longitude/tzid used for candle-lighting
10
- */
11
- location?: Location;
12
- /**
13
- * Gregorian or Hebrew year
14
- */
15
- year?: number;
16
- /**
17
- * to interpret year as Hebrew year
18
- */
19
- isHebrewYear?: boolean;
20
- /**
21
- * Gregorian or Hebrew month (to filter results to a single month)
22
- */
23
- month?: number | string;
24
- /**
25
- * generate calendar for multiple years (default 1, maximum 2000)
26
- */
27
- numYears?: number;
28
- /**
29
- * use specific start date (requires end date)
30
- */
31
- start?: number | HDate | Date;
32
- /**
33
- * use specific end date (requires start date)
34
- */
35
- end?: number | HDate | Date;
36
- /**
37
- * calculate candle-lighting and havdalah times
38
- */
39
- candlelighting?: boolean;
40
- /**
41
- * minutes before sundown to light candles (default 18)
42
- */
43
- candleLightingMins?: number;
44
- /**
45
- * minutes after sundown for Havdalah (typical values are 42, 50, or 72).
46
- * If `undefined` (the default), calculate Havdalah according to Tzeit Hakochavim -
47
- * Nightfall (the point when 3 small stars are observable in the night time sky with
48
- * the naked eye). If `0`, Havdalah times are suppressed.
49
- */
50
- havdalahMins?: number;
51
- /**
52
- * degrees for solar depression for Havdalah.
53
- * Default is 8.5 degrees for 3 small stars. use 7.083 degrees for 3 medium-sized stars.
54
- * If `0`, Havdalah times are suppressed.
55
- */
56
- havdalahDeg?: number;
57
- /**
58
- * degrees for solar depression for end of fast days.
59
- * Default is 7.083 degrees for 3 medium-sized stars. Other commonly-used values include
60
- * 6.45 degrees, as calculated by Rabbi Yechiel Michel Tucazinsky.
61
- */
62
- fastEndDeg?: number;
63
- /**
64
- * use elevation for calculations (default `false`).
65
- * If `true`, use elevation to affect the calculation of all sunrise/sunset based zmanim.
66
- * Note: there are some zmanim such as degree-based zmanim that are driven by the amount
67
- * of light in the sky and are not impacted by elevation.
68
- * These zmanim intentionally do not support elevation adjustment.
69
- */
70
- useElevation?: boolean;
71
- /**
72
- * calculate Parashat HaShavua on Saturdays
73
- */
74
- sedrot?: boolean;
75
- /**
76
- * Israeli holiday and sedra schedule
77
- */
78
- il?: boolean;
79
- /**
80
- * suppress minor fasts
81
- */
82
- noMinorFast?: boolean;
83
- /**
84
- * suppress modern holidays
85
- */
86
- noModern?: boolean;
87
- /**
88
- * suppress Rosh Chodesh
89
- */
90
- noRoshChodesh?: boolean;
91
- /**
92
- * add Shabbat Mevarchim
93
- */
94
- shabbatMevarchim?: boolean;
95
- /**
96
- * suppress Special Shabbat
97
- */
98
- noSpecialShabbat?: boolean;
99
- /**
100
- * suppress regular holidays
101
- */
102
- noHolidays?: boolean;
103
- /**
104
- * include Days of the Omer
105
- */
106
- omer?: boolean;
107
- /**
108
- * include event announcing the molad
109
- */
110
- molad?: boolean;
111
- /**
112
- * use Ashkenazi transliterations for event titles (default Sephardi transliterations)
113
- * @deprecated use `event.render('ashkenazi')` instead
114
- */
115
- ashkenazi?: boolean;
116
- /**
117
- * translate event titles according to a locale
118
- * Default value is `en`, also built-in are `he` and `ashkenazi`.
119
- * Additional locales (such as `ru` or `fr`) are provided by the
120
- * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
121
- */
122
- locale?: string;
123
- /**
124
- * print the Hebrew date for the entire date range
125
- */
126
- addHebrewDates?: boolean;
127
- /**
128
- * print the Hebrew date for dates with some events
129
- */
130
- addHebrewDatesForEvents?: boolean;
131
- /**
132
- * use bitmask from `flags` to filter events
133
- */
134
- mask?: number;
135
- /**
136
- * include Yom Kippur Katan (default `false`).
137
- * יוֹם כִּפּוּר קָטָן is a minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh.
138
- * Yom Kippur Katan is omitted in Elul (on the day before Rosh Hashanah),
139
- * Tishrei (Yom Kippur has just passed), Kislev (due to Chanukah)
140
- * and Nisan (fasting not permitted during Nisan).
141
- * When Rosh Chodesh occurs on Shabbat or Sunday, Yom Kippur Katan is observed on the preceding Thursday.
142
- * See {@link https://en.wikipedia.org/wiki/Yom_Kippur_Katan#Practices Wikipedia Yom Kippur Katan practices}
143
- */
144
- yomKippurKatan?: boolean;
145
- /**
146
- * include BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot (default `false`).
147
- */
148
- behab?: boolean;
149
- /**
150
- * Whether to use 12-hour time (as opposed to 24-hour time).
151
- * Possible values are `true` and `false`; the default is locale dependent.
152
- */
153
- hour12?: boolean;
154
- /**
155
- * map of options to enable daily study calendars
156
- * such as `dafYomi`, `mishnaYomi`, `nachYomi` with value `true`. For `yerushalmi`
157
- * the value should be a `number` for edition (`1` for Vilna, `2` for Schottenstein).
158
- */
159
- dailyLearning?: Record<string, DailyLearningValue>;
160
- /**
161
- * Yizkor (Hebrew: יִזְכּוֹר) is an Ashkenazi Jewish memorial prayer service
162
- * for the dead. Yizkor is recited in synagogue as part of the service
163
- * during four holidays each year:
164
- * 1. Yom Kippur
165
- * 2. Shmini Atzeret
166
- * 3. The final day of Passover (8th day Pesach in Diaspora, 7th day
167
- * Pesach in Israel)
168
- * 4. Shavuot (2nd day Shavuot in Diaspora)
169
- */
170
- yizkor?: boolean;
171
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,69 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- /**
4
- * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
5
- * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
6
- *
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'
19
- */
20
- export declare class DailyLearning {
21
- /**
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
- * );
33
- * @param name case insensitive
34
- * @param calendar a function that returns an `Event` or `null`
35
- * @param startDate the first date for which this calendar is valid
36
- */
37
- static addCalendar(name: string, calendar: (hd: HDate, il: boolean) => Event | null, startDate?: HDate): void;
38
- /**
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);
46
- * @param name case insensitive
47
- * @param hd Hebrew Date
48
- * @param il true for Israel, false for Diaspora
49
- */
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
- */
57
- static getStartDate(name: string): HDate | undefined;
58
- /**
59
- * Returns `true` if a learning calendar with the given name has been
60
- * registered via {@link addCalendar}.
61
- * @param name case insensitive
62
- */
63
- static has(name: string): boolean;
64
- /**
65
- * Returns the (lower-cased) names of all currently-registered learning
66
- * calendars.
67
- */
68
- static getCalendars(): string[];
69
- }
@@ -1,92 +0,0 @@
1
- const cals = new Map();
2
- /**
3
- * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
4
- * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
5
- *
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'
18
- */
19
- export class DailyLearning {
20
- /**
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
- * );
32
- * @param name case insensitive
33
- * @param calendar a function that returns an `Event` or `null`
34
- * @param startDate the first date for which this calendar is valid
35
- */
36
- static addCalendar(name, calendar, startDate) {
37
- if (typeof calendar !== 'function') {
38
- throw new TypeError(`Invalid calendar function: ${calendar}`);
39
- }
40
- cals.set(name.toLowerCase(), {
41
- fn: calendar,
42
- startDate: startDate,
43
- });
44
- }
45
- /**
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);
53
- * @param name case insensitive
54
- * @param hd Hebrew Date
55
- * @param il true for Israel, false for Diaspora
56
- */
57
- static lookup(name, hd, il) {
58
- const cal = cals.get(name.toLowerCase());
59
- if (typeof cal === 'object') {
60
- return cal.fn(hd, il);
61
- }
62
- return null;
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
- */
70
- static getStartDate(name) {
71
- const cal = cals.get(name.toLowerCase());
72
- if (typeof cal === 'object') {
73
- return cal.startDate;
74
- }
75
- return undefined;
76
- }
77
- /**
78
- * Returns `true` if a learning calendar with the given name has been
79
- * registered via {@link addCalendar}.
80
- * @param name case insensitive
81
- */
82
- static has(name) {
83
- return cals.has(name.toLowerCase());
84
- }
85
- /**
86
- * Returns the (lower-cased) names of all currently-registered learning
87
- * calendars.
88
- */
89
- static getCalendars() {
90
- return Array.from(cals.keys());
91
- }
92
- }
@@ -1,37 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- import './locale';
4
- /** Daily Hebrew date ("11th of Sivan, 5780") */
5
- export declare class HebrewDateEvent extends Event {
6
- /**
7
- * @param date
8
- */
9
- constructor(date: HDate);
10
- /**
11
- * @param [locale] Optional locale name (defaults to empty locale)
12
- * @example
13
- * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
14
- *
15
- * const hd = new HDate(15, months.CHESHVAN, 5769);
16
- * const ev = new HebrewDateEvent(hd);
17
- * console.log(ev.render('en')); // '15th of Cheshvan, 5769'
18
- * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
19
- */
20
- render(locale?: string): string;
21
- /**
22
- * @private
23
- * @param locale
24
- */
25
- private renderBriefHebrew;
26
- /**
27
- * @param [locale] Optional locale name (defaults to empty locale)
28
- * @example
29
- * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
30
- *
31
- * const hd = new HDate(15, months.CHESHVAN, 5769);
32
- * const ev = new HebrewDateEvent(hd);
33
- * console.log(ev.renderBrief()); // '15th of Cheshvan'
34
- * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
35
- */
36
- renderBrief(locale?: string): string;
37
- }
@@ -1,72 +0,0 @@
1
- import { gematriya, months, Locale } from '@hebcal/hdate';
2
- import { Event, flags } from './event';
3
- import './locale'; // Adds Hebrew and Ashkenazic translations
4
- /** Daily Hebrew date ("11th of Sivan, 5780") */
5
- export class HebrewDateEvent extends Event {
6
- /**
7
- * @param date
8
- */
9
- constructor(date) {
10
- super(date, date.toString(), flags.HEBREW_DATE);
11
- }
12
- /**
13
- * @param [locale] Optional locale name (defaults to empty locale)
14
- * @example
15
- * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
16
- *
17
- * const hd = new HDate(15, months.CHESHVAN, 5769);
18
- * const ev = new HebrewDateEvent(hd);
19
- * console.log(ev.render('en')); // '15th of Cheshvan, 5769'
20
- * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
21
- */
22
- render(locale) {
23
- const locale1 = locale?.toLowerCase();
24
- const locale0 = locale1 ?? 'en';
25
- const hd = this.getDate();
26
- switch (locale0) {
27
- case 'h':
28
- case 'he':
29
- return hd.renderGematriya(false);
30
- case 'he-x-nonikud':
31
- return hd.renderGematriya(true);
32
- default:
33
- return hd.render(locale0, true);
34
- }
35
- }
36
- /**
37
- * @private
38
- * @param locale
39
- */
40
- renderBriefHebrew(locale) {
41
- const hd = this.getDate();
42
- const dd = hd.getDate();
43
- const mm = Locale.gettext(hd.getMonthName(), locale);
44
- return gematriya(dd) + ' ' + mm;
45
- }
46
- /**
47
- * @param [locale] Optional locale name (defaults to empty locale)
48
- * @example
49
- * import {HDate, HebrewDateEvent, months} from '@hebcal/core';
50
- *
51
- * const hd = new HDate(15, months.CHESHVAN, 5769);
52
- * const ev = new HebrewDateEvent(hd);
53
- * console.log(ev.renderBrief()); // '15th of Cheshvan'
54
- * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
55
- */
56
- renderBrief(locale) {
57
- const locale1 = locale?.toLowerCase();
58
- const locale0 = locale1 ?? 'en';
59
- const hd = this.getDate();
60
- if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {
61
- return this.render(locale0);
62
- }
63
- switch (locale0) {
64
- case 'h':
65
- case 'he':
66
- case 'he-x-nonikud':
67
- return this.renderBriefHebrew(locale0);
68
- default:
69
- return hd.render(locale0, false);
70
- }
71
- }
72
- }
@@ -1,117 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- import './locale';
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
- */
20
- export declare class HolidayEvent extends Event {
21
- /** During Sukkot or Pesach */
22
- cholHaMoedDay?: number;
23
- /**
24
- * `true` if the fast day was postponed a day to avoid Shabbat.
25
- * - Tish'a B'Av postponed from the 9th to the 10th
26
- * - Tzom Tammuz postponed from the 17th to the 18th
27
- */
28
- observed?: boolean;
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
- */
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
- */
49
- url(): string | undefined;
50
- urlDateSuffix(): string;
51
- getEmoji(): string;
52
- getCategories(): string[];
53
- /**
54
- * Returns (translated) description of this event
55
- * @param [locale] Optional locale name (defaults to empty locale)
56
- */
57
- render(locale?: string): string;
58
- /**
59
- * Returns a brief (translated) description of this event.
60
- * For most events, this is the same as render(). For some events, it procudes
61
- * a shorter text (e.g. without a time or added description).
62
- * @param [locale] Optional locale name (defaults to empty locale)
63
- */
64
- renderBrief(locale?: string): string;
65
- }
66
- /**
67
- * Because Asara B'Tevet often occurs twice in the same Gregorian year,
68
- * we subclass HolidayEvent to generate the correct URL.
69
- */
70
- export declare class AsaraBTevetEvent extends HolidayEvent {
71
- urlDateSuffix(): string;
72
- }
73
- /**
74
- * Because Chanukah sometimes starts in December and ends in January,
75
- * we subclass HolidayEvent to generate the correct URL.
76
- */
77
- export declare class ChanukahEvent extends HolidayEvent {
78
- readonly chanukahDay?: number;
79
- /**
80
- * @param chanukahDay should be undefined for 1st night of Chanukah
81
- */
82
- constructor(date: HDate, desc: string, mask: number, chanukahDay?: number);
83
- urlDateSuffix(): string;
84
- }
85
- /** Represents Rosh Hashana, the Jewish New Year */
86
- export declare class RoshHashanaEvent extends HolidayEvent {
87
- private readonly hyear;
88
- /**
89
- * @private
90
- * @param date Hebrew date event occurs
91
- * @param hyear Hebrew year
92
- * @param mask optional holiday flags
93
- */
94
- constructor(date: HDate, hyear: number, mask: number);
95
- /**
96
- * Returns (translated) description of this event
97
- * @param [locale] Optional locale name (defaults to empty locale)
98
- */
99
- render(locale?: string): string;
100
- getEmoji(): string;
101
- }
102
- /** Represents Rosh Chodesh, the beginning of a new month */
103
- export declare class RoshChodeshEvent extends HolidayEvent {
104
- /**
105
- * Constructs Rosh Chodesh event
106
- * @param date Hebrew date event occurs
107
- * @param monthName Hebrew month name (not translated)
108
- */
109
- constructor(date: HDate, monthName: string);
110
- /**
111
- * Returns (translated) description of this event
112
- * @param [locale] Optional locale name (defaults to empty locale)
113
- */
114
- render(locale?: string): string;
115
- basename(): string;
116
- getEmoji(): string;
117
- }