@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,128 +0,0 @@
1
- import { HDate } from '@hebcal/hdate';
2
- import { Event } from './event';
3
- import './locale';
4
- /**
5
- * Language for counting the Omer can be English or Hebrew.
6
- * Lang for the Sefira can be English, Hebrew, or Hebrew in Sephardic transliteration.
7
- */
8
- export type OmerLang = 'en' | 'he' | 'translit';
9
- /**
10
- * Represents one of the 49 days of counting the Omer between Pesach and
11
- * Shavuot (16 Nisan through 5 Sivan).
12
- *
13
- * Each day has an associated Sefirah pairing (e.g. *Chesed shebiGevurah*),
14
- * a word from Psalm 67 (Lamnatzeach), a letter from verse 5 of Psalm 67,
15
- * and a word/acrostic from the Ana BeKoach prayer — all accessible via
16
- * the methods on this class.
17
- *
18
- * @example
19
- * import {OmerEvent, HDate, months} from '@hebcal/core';
20
- * const ev = new OmerEvent(new HDate(16, months.NISAN, 5784), 1);
21
- * ev.render('en'); // '1st day of the Omer'
22
- * ev.render('he'); // 'א׳ בָּעוֹמֶר'
23
- * ev.sefira('translit'); // 'Chesed shebChesed'
24
- * ev.getTodayIs('en'); // 'Today is 1 day of the Omer'
25
- */
26
- export declare class OmerEvent extends Event {
27
- private readonly weekNumber;
28
- private readonly daysWithinWeeks;
29
- readonly omer: number;
30
- /**
31
- * Constructs an Omer event for a given day (1–49).
32
- *
33
- * Throws `RangeError` if `omerDay` is outside 1–49.
34
- * @param date Hebrew date this Omer day is counted on (the evening of)
35
- * @param omerDay day of the Omer, 1 through 49
36
- */
37
- constructor(date: HDate, omerDay: number);
38
- /**
39
- * Returns the Sefirah pairing associated with this Omer day —
40
- * one of the seven lower Sefirot within another, calculated as
41
- * `day-within-week` of `week-within-cycle`. For example, on day 8
42
- * (week 2, day 1):
43
- * * חֶֽסֶד שֶׁבִּגְבוּרָה
44
- * * Chesed shebiGevurah
45
- * * Lovingkindness within Might
46
- * @example
47
- * import {OmerEvent, HDate, months} from '@hebcal/core';
48
- * const day8 = new OmerEvent(new HDate(23, months.NISAN, 5784), 8);
49
- * day8.sefira('en'); // 'Lovingkindness within Might'
50
- * day8.sefira('he'); // 'חֶֽסֶד שֶׁבִּגְבוּרָה'
51
- * day8.sefira('translit'); // 'Chesed shebiGevurah'
52
- * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)
53
- * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
54
- */
55
- sefira(lang?: OmerLang): string;
56
- /**
57
- * @param [locale] Optional locale name (defaults to empty locale)
58
- */
59
- render(locale?: string): string;
60
- /**
61
- * Returns translation of "Omer day 22" without ordinal numbers.
62
- * @param [locale] Optional locale name (defaults to empty locale)
63
- */
64
- renderBrief(locale?: string): string;
65
- /**
66
- * Returns an emoji number symbol with a circle, for example `㊲`
67
- * from the “Enclosed CJK Letters and Months” block of the Unicode standard
68
- * @returns a single Unicode character from `①` through `㊾`
69
- */
70
- getEmoji(): string;
71
- getWeeks(): number;
72
- getDaysWithinWeeks(): number;
73
- /**
74
- * Returns a sentence with that evening's omer count
75
- * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
76
- * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
77
- */
78
- getTodayIs(locale: string): string;
79
- url(): string | undefined;
80
- /**
81
- * Returns the word from Psalm 67 (לַמְנַצֵּחַ, "Lamnatzeach") corresponding
82
- * to this Omer day. Psalm 67 contains 49 words (excluding its opening verse),
83
- * one for each day of the Omer. The words are taken from verses 2–8, split on
84
- * spaces and maqef (־).
85
- * @returns a Hebrew word from Psalm 67
86
- * @example
87
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
88
- * ev.getLamnatzeachWord(); // 'אֱלֹהִים' (day 1, first word of verse 2)
89
- * @example
90
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
91
- * ev.getLamnatzeachWord(); // 'אָרֶץ' (day 49, last word of verse 8)
92
- */
93
- getLamnatzeachWord(): string;
94
- /**
95
- * Returns the letter from verse 5 of Psalm 67 corresponding to this Omer day.
96
- * Verse 5 (יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים…) contains exactly 49 letters,
97
- * one for each day of the Omer, and is used as a Kabbalistic meditation during
98
- * the counting.
99
- * @returns a single Hebrew letter from verse 5 of Psalm 67
100
- * @example
101
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
102
- * ev.getLamnatzeachLetter(); // 'י' (day 1, first letter of verse 5)
103
- * @example
104
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
105
- * ev.getLamnatzeachLetter(); // 'ה' (day 49, last letter of verse 5)
106
- */
107
- getLamnatzeachLetter(): string;
108
- /**
109
- * Returns the word from the Ana BeKoach prayer (אָנָּא בְּכֹחַ) corresponding
110
- * to this Omer day. Ana BeKoach is a 42-word Kabbalistic prayer whose initial
111
- * letters spell out the 42-letter name of God. The prayer has 7 verses of
112
- * 6 words each; the 7th entry of each group is the abbreviation of the acrostic
113
- * letters for that verse (e.g. `אב״ג ית״ץ` for verse 1). Together the 49
114
- * entries (7 verses × 7 entries) align with the 49 days of the Omer, connecting
115
- * each day to one of the lower seven Sefirot within a Sefirah.
116
- * @returns a Hebrew word or verse-abbreviation string from Ana BeKoach
117
- * @example
118
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
119
- * ev.getAnaBekoachWord(); // 'אָנָּא' (day 1, first word of verse 1)
120
- * @example
121
- * const ev = new OmerEvent(new HDate(22, 'Nisan', 5785), 7);
122
- * ev.getAnaBekoachWord(); // 'אב״ג ית״ץ' (day 7, acrostic abbreviation for verse 1)
123
- * @example
124
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
125
- * ev.getAnaBekoachWord(); // 'שק״ו צי״ת' (day 49, acrostic abbreviation for verse 7)
126
- */
127
- getAnaBekoachWord(): string;
128
- }
package/dist/src/omer.js DELETED
@@ -1,385 +0,0 @@
1
- import { Locale, gematriya } from '@hebcal/hdate';
2
- import { Event, flags } from './event';
3
- import './locale'; // Adds Hebrew and Ashkenazic translations
4
- import sefira from './sefira.json';
5
- const sefirot = {
6
- en: {
7
- infix: 'within ',
8
- infix26: 'within ',
9
- words: [
10
- '',
11
- 'Lovingkindness',
12
- 'Might',
13
- 'Beauty',
14
- 'Eternity',
15
- 'Splendor',
16
- 'Foundation',
17
- 'Majesty',
18
- ],
19
- pfxWords: null,
20
- },
21
- he: {
22
- infix: null,
23
- infix26: null,
24
- words: [
25
- '',
26
- 'חֶֽסֶד',
27
- 'גְּבוּרָה',
28
- 'תִּפְאֶֽרֶת',
29
- 'נֶּֽצַח',
30
- 'הוֹד',
31
- 'יְּסוֹד',
32
- 'מַלְכוּת',
33
- ],
34
- pfxWords: [
35
- '',
36
- 'שֶׁבְּחֶֽסֶד',
37
- 'שֶׁבִּגְבוּרָה',
38
- 'שֶׁבְּתִפְאֶֽרֶת',
39
- 'שֶׁבְּנֶֽצַח',
40
- 'שֶׁבְּהוֹד',
41
- 'שֶׁבִּיְסוֹד',
42
- 'שֶׁבְּמַלְכוּת',
43
- ],
44
- },
45
- translit: {
46
- infix: "sheb'",
47
- infix26: 'shebi',
48
- words: [
49
- '',
50
- 'Chesed',
51
- 'Gevurah',
52
- 'Tiferet',
53
- 'Netzach',
54
- 'Hod',
55
- 'Yesod',
56
- 'Malkhut',
57
- ],
58
- pfxWords: null,
59
- },
60
- };
61
- function checkDay(omerDay) {
62
- if (omerDay < 1 || omerDay > 49) {
63
- throw new RangeError(`Invalid Omer day ${omerDay}`);
64
- }
65
- }
66
- function getWeeks(omerDay) {
67
- const weekNum = Math.floor((omerDay - 1) / 7) + 1;
68
- const daysWithinWeeks = omerDay % 7 || 7;
69
- return [weekNum, daysWithinWeeks];
70
- }
71
- function omerTodayIsEn(omerDay) {
72
- const [weekNumber, daysWithinWeeks] = getWeeks(omerDay);
73
- const totalDaysStr = omerDay === 1 ? 'day' : 'days';
74
- let str = `Today is ${omerDay} ${totalDaysStr}`;
75
- if (weekNumber > 1 || omerDay === 7) {
76
- const day7 = daysWithinWeeks === 7;
77
- const numWeeks = day7 ? weekNumber : weekNumber - 1;
78
- const weeksStr = numWeeks === 1 ? 'week' : 'weeks';
79
- str += `, which are ${numWeeks} ${weeksStr}`;
80
- if (!day7) {
81
- const daysStr = daysWithinWeeks === 1 ? 'day' : 'days';
82
- str += ` and ${daysWithinWeeks} ${daysStr}`;
83
- }
84
- }
85
- return str + ' of the Omer';
86
- }
87
- // adapted from pip hdate package (GPL)
88
- // https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
89
- const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
90
- const ones = [
91
- '',
92
- 'אֶחָד',
93
- 'שְׁנַיִם',
94
- 'שְׁלוֹשָׁה',
95
- 'אַרְבָּעָה',
96
- 'חֲמִשָּׁה',
97
- 'שִׁשָּׁה',
98
- 'שִׁבְעָה',
99
- 'שְׁמוֹנָה',
100
- 'תִּשְׁעָה',
101
- ];
102
- const shnei = 'שְׁנֵי';
103
- const yamim = 'יָמִים';
104
- const shneiYamim = shnei + ' ' + yamim;
105
- const shavuot = 'שָׁבוּעוֹת';
106
- const yom = 'יוֹם';
107
- const yomEchad = yom + ' ' + ones[1];
108
- const asar = 'עָשָׂר';
109
- function omerTodayIsHe(omerDay) {
110
- const ten = Math.floor(omerDay / 10);
111
- const one = omerDay % 10;
112
- let str = 'הַיּוֹם ';
113
- if (omerDay === 11) {
114
- str += 'אַחַד ' + asar;
115
- }
116
- else if (omerDay === 12) {
117
- str += 'שְׁנֵים ' + asar;
118
- }
119
- else if (12 < omerDay && omerDay < 20) {
120
- str += ones[one] + ' ' + asar;
121
- }
122
- else if (omerDay > 9) {
123
- str += ones[one];
124
- if (one) {
125
- str += ' ';
126
- str += ten === 3 ? 'וּ' : 'וְ';
127
- }
128
- }
129
- if (omerDay > 2) {
130
- if (omerDay > 20 || omerDay === 10 || omerDay === 20) {
131
- str += tens[ten];
132
- }
133
- if (omerDay < 11) {
134
- str += ones[one] + ' ' + yamim + ' ';
135
- }
136
- else {
137
- str += ' ' + yom + ' ';
138
- }
139
- }
140
- else if (omerDay === 1) {
141
- str += yomEchad + ' ';
142
- }
143
- else {
144
- // omer == 2
145
- str += shneiYamim + ' ';
146
- }
147
- if (omerDay > 6) {
148
- str = str.trim(); // remove trailing space before comma
149
- str += ', שֶׁהֵם ';
150
- const weeks = Math.floor(omerDay / 7);
151
- const days = omerDay % 7;
152
- if (weeks > 2) {
153
- str += ones[weeks] + ' ' + shavuot + ' ';
154
- }
155
- else if (weeks === 1) {
156
- str += 'שָׁבֽוּעַ' + ' ' + ones[1] + ' ';
157
- }
158
- else {
159
- // weeks == 2
160
- str += shnei + ' ' + shavuot + ' ';
161
- }
162
- if (days) {
163
- if (days === 2 || days === 3) {
164
- str += 'וּ';
165
- }
166
- else if (days === 5) {
167
- str += 'וַ';
168
- }
169
- else {
170
- str += 'וְ';
171
- }
172
- if (days > 2) {
173
- str += ones[days] + ' ' + yamim + ' ';
174
- }
175
- else if (days === 1) {
176
- str += yomEchad + ' ';
177
- }
178
- else {
179
- // days == 2
180
- str += shneiYamim + ' ';
181
- }
182
- }
183
- }
184
- str += 'לָעֽוֹמֶר';
185
- return str.normalize();
186
- }
187
- const anaBekoach = sefira.anaBekoach;
188
- const ps67lines = sefira.ps67lines;
189
- const lamnatzeach = ps67lines.flatMap((x) => x.split(/[ ־]/));
190
- const lamnatzeachLetters = sefira.lamnatzeachLetters.split('');
191
- /**
192
- * Represents one of the 49 days of counting the Omer between Pesach and
193
- * Shavuot (16 Nisan through 5 Sivan).
194
- *
195
- * Each day has an associated Sefirah pairing (e.g. *Chesed shebiGevurah*),
196
- * a word from Psalm 67 (Lamnatzeach), a letter from verse 5 of Psalm 67,
197
- * and a word/acrostic from the Ana BeKoach prayer — all accessible via
198
- * the methods on this class.
199
- *
200
- * @example
201
- * import {OmerEvent, HDate, months} from '@hebcal/core';
202
- * const ev = new OmerEvent(new HDate(16, months.NISAN, 5784), 1);
203
- * ev.render('en'); // '1st day of the Omer'
204
- * ev.render('he'); // 'א׳ בָּעוֹמֶר'
205
- * ev.sefira('translit'); // 'Chesed shebChesed'
206
- * ev.getTodayIs('en'); // 'Today is 1 day of the Omer'
207
- */
208
- export class OmerEvent extends Event {
209
- weekNumber;
210
- daysWithinWeeks;
211
- omer;
212
- /**
213
- * Constructs an Omer event for a given day (1–49).
214
- *
215
- * Throws `RangeError` if `omerDay` is outside 1–49.
216
- * @param date Hebrew date this Omer day is counted on (the evening of)
217
- * @param omerDay day of the Omer, 1 through 49
218
- */
219
- constructor(date, omerDay) {
220
- super(date, `Omer ${omerDay}`, flags.OMER_COUNT);
221
- checkDay(omerDay);
222
- this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;
223
- this.daysWithinWeeks = omerDay % 7 || 7;
224
- this.omer = omerDay;
225
- }
226
- /**
227
- * Returns the Sefirah pairing associated with this Omer day —
228
- * one of the seven lower Sefirot within another, calculated as
229
- * `day-within-week` of `week-within-cycle`. For example, on day 8
230
- * (week 2, day 1):
231
- * * חֶֽסֶד שֶׁבִּגְבוּרָה
232
- * * Chesed shebiGevurah
233
- * * Lovingkindness within Might
234
- * @example
235
- * import {OmerEvent, HDate, months} from '@hebcal/core';
236
- * const day8 = new OmerEvent(new HDate(23, months.NISAN, 5784), 8);
237
- * day8.sefira('en'); // 'Lovingkindness within Might'
238
- * day8.sefira('he'); // 'חֶֽסֶד שֶׁבִּגְבוּרָה'
239
- * day8.sefira('translit'); // 'Chesed shebiGevurah'
240
- * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)
241
- * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
242
- */
243
- sefira(lang = 'en') {
244
- if (lang !== 'he' && lang !== 'translit') {
245
- lang = 'en';
246
- }
247
- const [weekNum, daysWithinWeeks] = getWeeks(this.omer);
248
- const config = sefirot[lang];
249
- const pfxWords = config.pfxWords;
250
- const words = config.words;
251
- const week = pfxWords ? pfxWords[weekNum] : words[weekNum];
252
- const dayWithinWeek = words[daysWithinWeeks];
253
- const infix = pfxWords
254
- ? ''
255
- : weekNum === 2 || weekNum === 6
256
- ? config.infix26
257
- : config.infix;
258
- return (dayWithinWeek + ' ' + infix + week).normalize();
259
- }
260
- /**
261
- * @param [locale] Optional locale name (defaults to empty locale)
262
- */
263
- render(locale) {
264
- const isHebrewLocale = Locale.isHebrewLocale(locale);
265
- const omer = this.omer;
266
- const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);
267
- return nth + ' ' + Locale.gettext('day of the Omer', locale);
268
- }
269
- /**
270
- * Returns translation of "Omer day 22" without ordinal numbers.
271
- * @param [locale] Optional locale name (defaults to empty locale)
272
- */
273
- renderBrief(locale) {
274
- return (Locale.gettext('Omer', locale) +
275
- ' ' +
276
- Locale.gettext('day', locale) +
277
- ' ' +
278
- this.omer);
279
- }
280
- /**
281
- * Returns an emoji number symbol with a circle, for example `㊲`
282
- * from the “Enclosed CJK Letters and Months” block of the Unicode standard
283
- * @returns a single Unicode character from `①` through `㊾`
284
- */
285
- getEmoji() {
286
- if (typeof this.emoji === 'string')
287
- return this.emoji;
288
- let codePoint;
289
- const omerDay = this.omer;
290
- if (omerDay <= 20) {
291
- codePoint = 9312 + omerDay - 1;
292
- }
293
- else if (omerDay <= 35) {
294
- // between 21 and 35 inclusive
295
- codePoint = 12881 + omerDay - 21;
296
- }
297
- else {
298
- // between 36 and 49 inclusive
299
- codePoint = 12977 + omerDay - 36;
300
- }
301
- return String.fromCodePoint(codePoint);
302
- }
303
- getWeeks() {
304
- const day7 = this.daysWithinWeeks === 7;
305
- return day7 ? this.weekNumber : this.weekNumber - 1;
306
- }
307
- getDaysWithinWeeks() {
308
- return this.daysWithinWeeks;
309
- }
310
- /**
311
- * Returns a sentence with that evening's omer count
312
- * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
313
- * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
314
- */
315
- getTodayIs(locale) {
316
- locale = (locale || 'en').toLowerCase();
317
- const isHebrew = Locale.isHebrewLocale(locale);
318
- const str = isHebrew ? omerTodayIsHe(this.omer) : omerTodayIsEn(this.omer);
319
- if (locale === 'he-x-nonikud') {
320
- return Locale.hebrewStripNikkud(str);
321
- }
322
- return str;
323
- }
324
- url() {
325
- const year = this.getDate().getFullYear();
326
- if (year < 5000 || year > 6759) {
327
- return undefined;
328
- }
329
- return `https://www.hebcal.com/omer/${year}/${this.omer}`;
330
- }
331
- /**
332
- * Returns the word from Psalm 67 (לַמְנַצֵּחַ, "Lamnatzeach") corresponding
333
- * to this Omer day. Psalm 67 contains 49 words (excluding its opening verse),
334
- * one for each day of the Omer. The words are taken from verses 2–8, split on
335
- * spaces and maqef (־).
336
- * @returns a Hebrew word from Psalm 67
337
- * @example
338
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
339
- * ev.getLamnatzeachWord(); // 'אֱלֹהִים' (day 1, first word of verse 2)
340
- * @example
341
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
342
- * ev.getLamnatzeachWord(); // 'אָרֶץ' (day 49, last word of verse 8)
343
- */
344
- getLamnatzeachWord() {
345
- return lamnatzeach[this.omer - 1];
346
- }
347
- /**
348
- * Returns the letter from verse 5 of Psalm 67 corresponding to this Omer day.
349
- * Verse 5 (יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים…) contains exactly 49 letters,
350
- * one for each day of the Omer, and is used as a Kabbalistic meditation during
351
- * the counting.
352
- * @returns a single Hebrew letter from verse 5 of Psalm 67
353
- * @example
354
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
355
- * ev.getLamnatzeachLetter(); // 'י' (day 1, first letter of verse 5)
356
- * @example
357
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
358
- * ev.getLamnatzeachLetter(); // 'ה' (day 49, last letter of verse 5)
359
- */
360
- getLamnatzeachLetter() {
361
- return lamnatzeachLetters[this.omer - 1];
362
- }
363
- /**
364
- * Returns the word from the Ana BeKoach prayer (אָנָּא בְּכֹחַ) corresponding
365
- * to this Omer day. Ana BeKoach is a 42-word Kabbalistic prayer whose initial
366
- * letters spell out the 42-letter name of God. The prayer has 7 verses of
367
- * 6 words each; the 7th entry of each group is the abbreviation of the acrostic
368
- * letters for that verse (e.g. `אב״ג ית״ץ` for verse 1). Together the 49
369
- * entries (7 verses × 7 entries) align with the 49 days of the Omer, connecting
370
- * each day to one of the lower seven Sefirot within a Sefirah.
371
- * @returns a Hebrew word or verse-abbreviation string from Ana BeKoach
372
- * @example
373
- * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);
374
- * ev.getAnaBekoachWord(); // 'אָנָּא' (day 1, first word of verse 1)
375
- * @example
376
- * const ev = new OmerEvent(new HDate(22, 'Nisan', 5785), 7);
377
- * ev.getAnaBekoachWord(); // 'אב״ג ית״ץ' (day 7, acrostic abbreviation for verse 1)
378
- * @example
379
- * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);
380
- * ev.getAnaBekoachWord(); // 'שק״ו צי״ת' (day 49, acrostic abbreviation for verse 7)
381
- */
382
- getAnaBekoachWord() {
383
- return anaBekoach[this.omer - 1].normalize();
384
- }
385
- }
@@ -1,2 +0,0 @@
1
- /** @private */
2
- export declare function renderParshaName(parsha: string[], locale?: string): string;
@@ -1,13 +0,0 @@
1
- import { Locale } from './locale';
2
- import { smartApostrophe } from './string';
3
- /** @private */
4
- export function renderParshaName(parsha, locale) {
5
- let name = Locale.gettext(parsha[0], locale);
6
- if (parsha.length === 2) {
7
- const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';
8
- name += hyphen + Locale.gettext(parsha[1], locale);
9
- }
10
- name = smartApostrophe(name);
11
- const str = Locale.gettext('Parashat', locale) + ' ' + name;
12
- return str.normalize();
13
- }
@@ -1,20 +0,0 @@
1
- import { ParshaEvent } from './ParshaEvent';
2
- /**
3
- * Calculates the weekly Torah Reading (Parashat HaShavua) on Saturdays for
4
- * an entire Hebrew year.
5
- *
6
- * Saturdays on which a Yom Tov reading displaces the regular parsha
7
- * (e.g. Shabbat Chol ha-Moed Pesach/Sukkot, Yom Kippur on Shabbat) are
8
- * skipped — for those use {@link getHolidaysOnDate} or
9
- * {@link Sedra.lookup}.
10
- * @example
11
- * import {parshaYear} from '@hebcal/core';
12
- * const events = parshaYear(5784, false);
13
- * events[0].render('en'); // 'Parashat Vayeilech'
14
- * events[0].getDate().toString(); // '4 Tishrei 5784'
15
- * @param year Hebrew year
16
- * @param il Israel (false for Diaspora)
17
- * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
18
- * (non-holiday) Parashat HaShavua
19
- */
20
- export declare function parshaYear(year: number, il: boolean): ParshaEvent[];
@@ -1,35 +0,0 @@
1
- import { HDate, months } from '@hebcal/hdate';
2
- import { ParshaEvent } from './ParshaEvent';
3
- import { getSedra } from './sedra';
4
- /**
5
- * Calculates the weekly Torah Reading (Parashat HaShavua) on Saturdays for
6
- * an entire Hebrew year.
7
- *
8
- * Saturdays on which a Yom Tov reading displaces the regular parsha
9
- * (e.g. Shabbat Chol ha-Moed Pesach/Sukkot, Yom Kippur on Shabbat) are
10
- * skipped — for those use {@link getHolidaysOnDate} or
11
- * {@link Sedra.lookup}.
12
- * @example
13
- * import {parshaYear} from '@hebcal/core';
14
- * const events = parshaYear(5784, false);
15
- * events[0].render('en'); // 'Parashat Vayeilech'
16
- * events[0].getDate().toString(); // '4 Tishrei 5784'
17
- * @param year Hebrew year
18
- * @param il Israel (false for Diaspora)
19
- * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
20
- * (non-holiday) Parashat HaShavua
21
- */
22
- export function parshaYear(year, il) {
23
- const sedra = getSedra(year, il);
24
- const startAbs = sedra.getFirstSaturday();
25
- const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);
26
- const events = [];
27
- for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {
28
- const parsha = sedra.lookup(absDt);
29
- if (!parsha.chag) {
30
- const ev = new ParshaEvent(parsha);
31
- events.push(ev);
32
- }
33
- }
34
- return events;
35
- }
@@ -1,2 +0,0 @@
1
- /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "6.6.0";
@@ -1,2 +0,0 @@
1
- /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export const version = '6.6.0';
@@ -1,8 +0,0 @@
1
- import { CalOptions } from './CalOptions';
2
- /**
3
- * @private
4
- * @param timeStr - original time like "20:30"
5
- * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
6
- * @param options
7
- */
8
- export declare function reformatTimeStr(timeStr: string, suffix: string, options?: CalOptions): string;
@@ -1,47 +0,0 @@
1
- const hour12cc = {
2
- US: 1,
3
- CA: 1,
4
- BR: 1,
5
- AU: 1,
6
- NZ: 1,
7
- DO: 1,
8
- PR: 1,
9
- GR: 1,
10
- IN: 1,
11
- KR: 1,
12
- NP: 1,
13
- ZA: 1,
14
- };
15
- /**
16
- * @private
17
- * @param timeStr - original time like "20:30"
18
- * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
19
- * @param options
20
- */
21
- export function reformatTimeStr(timeStr, suffix, options) {
22
- if (typeof timeStr !== 'string')
23
- throw new TypeError(`Bad timeStr: ${timeStr}`);
24
- const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');
25
- const hour12 = options?.hour12;
26
- if (hour12 !== undefined && !hour12) {
27
- return timeStr;
28
- }
29
- if (!hour12 && hour12cc[cc] === undefined) {
30
- return timeStr;
31
- }
32
- const hm = timeStr.split(':');
33
- let hour = parseInt(hm[0], 10);
34
- if (hour < 12 && suffix) {
35
- suffix = suffix.replace('p', 'a').replace('P', 'A');
36
- if (hour === 0) {
37
- hour = 12;
38
- }
39
- }
40
- else if (hour > 12) {
41
- hour = hour % 12;
42
- }
43
- else if (hour === 0) {
44
- hour = '00';
45
- }
46
- return `${hour}:${hm[1]}${suffix}`;
47
- }