@hebcal/core 6.0.6 → 6.0.7

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 (142) hide show
  1. package/README.md +42 -27
  2. package/dist/bundle.js +13 -8
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +3 -3
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/DailyLearning.js +1 -1
  7. package/dist/esm/HebrewDateEvent.js +1 -1
  8. package/dist/esm/HolidayEvent.js +1 -1
  9. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  10. package/dist/esm/ParshaEvent.js +1 -1
  11. package/dist/esm/TimedEvent.js +1 -1
  12. package/dist/esm/YomKippurKatanEvent.js +1 -1
  13. package/dist/esm/ashkenazi.po.js +1 -1
  14. package/dist/esm/calendar.js +1 -1
  15. package/dist/esm/candles.js +1 -1
  16. package/dist/esm/event.js +1 -1
  17. package/dist/esm/getStartAndEnd.js +1 -1
  18. package/dist/esm/hallel.js +1 -1
  19. package/dist/esm/he-x-NoNikud.po.d.ts +2 -0
  20. package/dist/esm/he-x-NoNikud.po.js +2 -2
  21. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  22. package/dist/esm/he.po.d.ts +1 -0
  23. package/dist/esm/he.po.js +2 -2
  24. package/dist/esm/he.po.js.map +1 -1
  25. package/dist/esm/hebcal.js +1 -1
  26. package/dist/esm/holidays.js +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/isAssurBemlacha.js +1 -1
  29. package/dist/esm/locale.js +1 -1
  30. package/dist/esm/location.js +2 -2
  31. package/dist/esm/location.js.map +1 -1
  32. package/dist/esm/modern.js +1 -1
  33. package/dist/esm/molad.js +1 -1
  34. package/dist/esm/omer.js +1 -1
  35. package/dist/esm/parshaName.js +1 -1
  36. package/dist/esm/parshaYear.d.ts +2 -2
  37. package/dist/esm/parshaYear.js +1 -1
  38. package/dist/esm/parshaYear.js.map +1 -1
  39. package/dist/esm/pkgVersion.d.ts +1 -1
  40. package/dist/esm/pkgVersion.js +2 -2
  41. package/dist/esm/pkgVersion.js.map +1 -1
  42. package/dist/esm/reformatTimeStr.js +1 -1
  43. package/dist/esm/sedra.d.ts +5 -1
  44. package/dist/esm/sedra.js +9 -3
  45. package/dist/esm/sedra.js.map +1 -1
  46. package/dist/esm/staticHolidays.js +1 -2
  47. package/dist/esm/staticHolidays.js.map +1 -1
  48. package/dist/esm/tachanun.js +1 -1
  49. package/dist/esm/zmanim.js +1 -1
  50. package/dist/he-x-NoNikud.po.d.ts +2 -0
  51. package/dist/he.po.d.ts +1 -0
  52. package/dist/parshaYear.d.ts +2 -2
  53. package/dist/pkgVersion.d.ts +1 -1
  54. package/dist/po2json.d.ts +1 -0
  55. package/dist/po2json.js +41 -0
  56. package/dist/sedra.d.ts +5 -1
  57. package/dist/size-demo/dist/getHoliday.d.ts +1944 -0
  58. package/dist/size-demo/dist/getHoliday.js +3712 -0
  59. package/dist/size-demo/dist/parshiyot.js +10662 -0
  60. package/dist/size-demo/dist/sedra.d.ts +1411 -0
  61. package/dist/size-demo/dist/sedra.js +2359 -0
  62. package/dist/size-demo/dist/tachanun.d.ts +1015 -0
  63. package/dist/size-demo/dist/tachanun.js +1755 -0
  64. package/dist/size-demo/getHoliday.d.ts +1 -0
  65. package/dist/size-demo/getHoliday.js +3 -0
  66. package/dist/size-demo/parshiyot.d.ts +1 -0
  67. package/dist/size-demo/parshiyot.js +11 -0
  68. package/dist/size-demo/rollup.config.d.ts +3 -0
  69. package/dist/size-demo/rollup.config.js +47 -0
  70. package/dist/size-demo/sedra.d.ts +1 -0
  71. package/dist/size-demo/sedra.js +3 -0
  72. package/dist/size-demo/tachanun.d.ts +1 -0
  73. package/dist/size-demo/tachanun.js +3 -0
  74. package/dist/src/CalOptions.d.ts +168 -0
  75. package/dist/src/CalOptions.js +1 -0
  76. package/dist/src/DailyLearning.d.ts +32 -0
  77. package/dist/src/DailyLearning.js +55 -0
  78. package/dist/src/HebrewDateEvent.d.ts +37 -0
  79. package/dist/src/HebrewDateEvent.js +72 -0
  80. package/dist/src/HolidayEvent.d.ts +83 -0
  81. package/dist/src/HolidayEvent.js +186 -0
  82. package/dist/src/MevarchimChodeshEvent.d.ts +26 -0
  83. package/dist/src/MevarchimChodeshEvent.js +50 -0
  84. package/dist/src/ParshaEvent.d.ts +19 -0
  85. package/dist/src/ParshaEvent.js +43 -0
  86. package/dist/src/TimedEvent.d.ts +47 -0
  87. package/dist/src/TimedEvent.js +92 -0
  88. package/dist/src/YomKippurKatanEvent.d.ts +23 -0
  89. package/dist/src/YomKippurKatanEvent.js +38 -0
  90. package/dist/src/ashkenazi.po.d.ts +70 -0
  91. package/dist/src/ashkenazi.po.js +1 -0
  92. package/dist/src/calendar.d.ts +111 -0
  93. package/dist/src/calendar.js +660 -0
  94. package/dist/src/candles.d.ts +44 -0
  95. package/dist/src/candles.js +163 -0
  96. package/dist/src/event.d.ts +188 -0
  97. package/dist/src/event.js +233 -0
  98. package/dist/src/getStartAndEnd.d.ts +6 -0
  99. package/dist/src/getStartAndEnd.js +97 -0
  100. package/dist/src/hallel.d.ts +6 -0
  101. package/dist/src/hallel.js +47 -0
  102. package/dist/src/he-x-NoNikud.po.d.ts +15 -0
  103. package/dist/src/he-x-NoNikud.po.js +1 -0
  104. package/dist/src/he.po.d.ts +195 -0
  105. package/dist/src/he.po.js +1 -0
  106. package/dist/src/hebcal.d.ts +260 -0
  107. package/dist/src/hebcal.js +332 -0
  108. package/dist/src/holidays.d.ts +22 -0
  109. package/dist/src/holidays.js +288 -0
  110. package/dist/src/index.d.ts +26 -0
  111. package/dist/src/index.js +24 -0
  112. package/dist/src/isAssurBemlacha.d.ts +9 -0
  113. package/dist/src/isAssurBemlacha.js +62 -0
  114. package/dist/src/locale.d.ts +2 -0
  115. package/dist/src/locale.js +11 -0
  116. package/dist/src/location.d.ts +73 -0
  117. package/dist/src/location.js +306 -0
  118. package/dist/src/modern.d.ts +18 -0
  119. package/dist/src/modern.js +59 -0
  120. package/dist/src/molad.d.ts +62 -0
  121. package/dist/src/molad.js +169 -0
  122. package/dist/src/omer.d.ts +53 -0
  123. package/dist/src/omer.js +302 -0
  124. package/dist/src/parshaName.d.ts +2 -0
  125. package/dist/src/parshaName.js +13 -0
  126. package/dist/src/parshaYear.d.ts +9 -0
  127. package/dist/src/parshaYear.js +24 -0
  128. package/dist/src/pkgVersion.d.ts +2 -0
  129. package/dist/src/pkgVersion.js +2 -0
  130. package/dist/src/reformatTimeStr.d.ts +8 -0
  131. package/dist/src/reformatTimeStr.js +48 -0
  132. package/dist/src/sedra.d.ts +95 -0
  133. package/dist/src/sedra.js +477 -0
  134. package/dist/src/staticHolidays.d.ts +176 -0
  135. package/dist/src/staticHolidays.js +614 -0
  136. package/dist/src/tachanun.d.ts +29 -0
  137. package/dist/src/tachanun.js +120 -0
  138. package/dist/src/zmanim.d.ts +347 -0
  139. package/dist/src/zmanim.js +579 -0
  140. package/dist/version.d.ts +1 -0
  141. package/dist/version.js +9 -0
  142. package/package.json +11 -8
@@ -0,0 +1,169 @@
1
+ /* eslint-disable camelcase */
2
+ import { Event, flags } from './event';
3
+ import { HDate, Locale, molad, pad2 } from '@hebcal/hdate';
4
+ import { reformatTimeStr } from './reformatTimeStr';
5
+ import './locale'; // Adds Hebrew and Ashkenazic translations
6
+ const enDoW = [
7
+ 'Sunday',
8
+ 'Monday',
9
+ 'Tuesday',
10
+ 'Wednesday',
11
+ 'Thursday',
12
+ 'Friday',
13
+ 'Saturday',
14
+ ];
15
+ const heDayNames = [
16
+ 'רִאשׁוֹן',
17
+ 'שֵׁנִי',
18
+ 'שְׁלִישִׁי',
19
+ 'רְבִיעִי',
20
+ 'חֲמִישִׁי',
21
+ 'שִׁישִּׁי',
22
+ 'שַׁבָּת',
23
+ ];
24
+ const frDoW = [
25
+ 'Dimanche',
26
+ 'Lundi',
27
+ 'Mardi',
28
+ 'Mercredi',
29
+ 'Jeudi',
30
+ 'Vendredi',
31
+ 'Samedi',
32
+ ];
33
+ const night = 'בַּלַּ֥יְלָה';
34
+ function getDayNames(locale) {
35
+ if (locale === 'he' || locale === 'he-x-nonikud' || locale === 'h') {
36
+ return heDayNames;
37
+ }
38
+ else if (locale === 'fr') {
39
+ return frDoW;
40
+ }
41
+ return enDoW;
42
+ }
43
+ function getHebrewTimeOfDay(hour) {
44
+ if (hour < 5)
45
+ return night;
46
+ else if (hour < 12)
47
+ return 'בַּבֹּקֶר';
48
+ else if (hour < 17)
49
+ return 'בַּצׇּהֳרַיִים';
50
+ else if (hour < 21)
51
+ return 'בָּעֶרֶב';
52
+ return night;
53
+ }
54
+ /**
55
+ * Represents a molad, the moment when the new moon is "born"
56
+ */
57
+ export class Molad {
58
+ /**
59
+ * Calculates the molad for a Hebrew month
60
+ * @param year
61
+ * @param month
62
+ */
63
+ constructor(year, month) {
64
+ this.m = molad(year, month);
65
+ }
66
+ /**
67
+ */
68
+ getYear() {
69
+ return this.m.year;
70
+ }
71
+ /**
72
+ */
73
+ getMonth() {
74
+ return this.m.month;
75
+ }
76
+ /**
77
+ */
78
+ getMonthName() {
79
+ return HDate.getMonthName(this.m.month, this.m.year);
80
+ }
81
+ /**
82
+ * @returns Day of Week (0=Sunday, 6=Saturday)
83
+ */
84
+ getDow() {
85
+ return this.m.dayOfWeek;
86
+ }
87
+ /**
88
+ * @returns hour of day (0-23)
89
+ */
90
+ getHour() {
91
+ return this.m.hour;
92
+ }
93
+ /**
94
+ * @returns minutes past hour (0-59)
95
+ */
96
+ getMinutes() {
97
+ return this.m.minutes;
98
+ }
99
+ /**
100
+ * @returns parts of a minute (0-17)
101
+ */
102
+ getChalakim() {
103
+ return this.m.chalakim;
104
+ }
105
+ /**
106
+ * @param [locale] Optional locale name (defaults to empty locale)
107
+ * @param options
108
+ */
109
+ render(locale, options) {
110
+ var _a;
111
+ locale = locale !== null && locale !== void 0 ? locale : 'en';
112
+ if (typeof locale === 'string') {
113
+ locale = locale.toLowerCase();
114
+ }
115
+ const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
116
+ const monthName = Locale.gettext(this.getMonthName(), locale);
117
+ const dayNames = getDayNames(locale);
118
+ const dow = dayNames[this.getDow()];
119
+ const minutes = this.getMinutes();
120
+ const hour = this.getHour();
121
+ const chalakim = this.getChalakim();
122
+ const moladStr = Locale.gettext('Molad', locale);
123
+ const minutesStr = (_a = Locale.lookupTranslation('min', locale)) !== null && _a !== void 0 ? _a : 'minutes';
124
+ const chalakimStr = Locale.gettext('chalakim', locale);
125
+ const and = Locale.gettext('and', locale);
126
+ if (isHebrewLocale) {
127
+ const ampm = getHebrewTimeOfDay(hour);
128
+ let result = `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +
129
+ `בְּשָׁעָה ${hour} ${ampm}, ` +
130
+ `ו-${minutes} ${minutesStr}`;
131
+ if (chalakim !== 0) {
132
+ result += ` ו-${chalakim} ${chalakimStr}`;
133
+ }
134
+ if (locale === 'he-x-nonikud') {
135
+ return Locale.hebrewStripNikkud(result);
136
+ }
137
+ return result;
138
+ }
139
+ const fmtTime = reformatTimeStr(`${hour}:${pad2(minutes)}`, 'pm', options);
140
+ const month = monthName.replace(/'/g, '’');
141
+ const result = `${moladStr} ${month}: ${dow}, ${fmtTime}`;
142
+ if (chalakim === 0) {
143
+ return result;
144
+ }
145
+ return result + ` ${and} ${chalakim} ${chalakimStr}`;
146
+ }
147
+ }
148
+ /** Represents a Molad announcement on Shabbat Mevarchim */
149
+ export class MoladEvent extends Event {
150
+ /**
151
+ * @param date Hebrew date event occurs
152
+ * @param hyear molad year
153
+ * @param hmonth molad month
154
+ * @param options
155
+ */
156
+ constructor(date, hyear, hmonth, options) {
157
+ const m = new Molad(hyear, hmonth);
158
+ const monthName = m.getMonthName();
159
+ super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);
160
+ this.molad = m;
161
+ this.options = options;
162
+ }
163
+ /**
164
+ * @param [locale] Optional locale name (defaults to empty locale)
165
+ */
166
+ render(locale) {
167
+ return this.molad.render(locale, this.options);
168
+ }
169
+ }
@@ -0,0 +1,53 @@
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
+ /** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */
10
+ export declare class OmerEvent extends Event {
11
+ private readonly weekNumber;
12
+ private readonly daysWithinWeeks;
13
+ readonly omer: number;
14
+ emoji?: string;
15
+ /**
16
+ * @param date
17
+ * @param omerDay
18
+ */
19
+ constructor(date: HDate, omerDay: number);
20
+ /**
21
+ * Returns the sefira. For example, on day 8:
22
+ * * חֶֽסֶד שֶׁבִּגְבוּרָה
23
+ * * Chesed shebiGevurah
24
+ * * Lovingkindness within Might
25
+ * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)
26
+ * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
27
+ */
28
+ sefira(lang?: OmerLang): string;
29
+ /**
30
+ * @param [locale] Optional locale name (defaults to empty locale)
31
+ */
32
+ render(locale?: string): string;
33
+ /**
34
+ * Returns translation of "Omer day 22" without ordinal numbers.
35
+ * @param [locale] Optional locale name (defaults to empty locale)
36
+ */
37
+ renderBrief(locale?: string): string;
38
+ /**
39
+ * Returns an emoji number symbol with a circle, for example `㊲`
40
+ * from the “Enclosed CJK Letters and Months” block of the Unicode standard
41
+ * @returns a single Unicode character from `①` through `㊾`
42
+ */
43
+ getEmoji(): string;
44
+ getWeeks(): number;
45
+ getDaysWithinWeeks(): number;
46
+ /**
47
+ * Returns a sentence with that evening's omer count
48
+ * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
49
+ * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
50
+ */
51
+ getTodayIs(locale: string): string;
52
+ url(): string | undefined;
53
+ }
@@ -0,0 +1,302 @@
1
+ import { Locale, gematriya } from '@hebcal/hdate';
2
+ import { Event, flags } from './event';
3
+ import './locale'; // Adds Hebrew and Ashkenazic translations
4
+ const sefirot = {
5
+ en: {
6
+ infix: 'within ',
7
+ infix26: 'within ',
8
+ words: [
9
+ '',
10
+ 'Lovingkindness',
11
+ 'Might',
12
+ 'Beauty',
13
+ 'Eternity',
14
+ 'Splendor',
15
+ 'Foundation',
16
+ 'Majesty',
17
+ ],
18
+ pfxWords: null,
19
+ },
20
+ he: {
21
+ infix: null,
22
+ infix26: null,
23
+ words: [
24
+ '',
25
+ 'חֶֽסֶד',
26
+ 'גְּבוּרָה',
27
+ 'תִּפְאֶֽרֶת',
28
+ 'נֶּֽצַח',
29
+ 'הוֹד',
30
+ 'יְּסוֹד',
31
+ 'מַלְכוּת',
32
+ ],
33
+ pfxWords: [
34
+ '',
35
+ 'שֶׁבְּחֶֽסֶד',
36
+ 'שֶׁבִּגְבוּרָה',
37
+ 'שֶׁבְּתִפְאֶֽרֶת',
38
+ 'שֶׁבְּנֶֽצַח',
39
+ 'שֶׁבְּהוֹד',
40
+ 'שֶׁבִּיְסוֹד',
41
+ 'שֶׁבְּמַלְכוּת',
42
+ ],
43
+ },
44
+ translit: {
45
+ infix: "sheb'",
46
+ infix26: 'shebi',
47
+ words: [
48
+ '',
49
+ 'Chesed',
50
+ 'Gevurah',
51
+ 'Tiferet',
52
+ 'Netzach',
53
+ 'Hod',
54
+ 'Yesod',
55
+ 'Malkhut',
56
+ ],
57
+ pfxWords: null,
58
+ },
59
+ };
60
+ function checkDay(omerDay) {
61
+ if (omerDay < 1 || omerDay > 49) {
62
+ throw new RangeError(`Invalid Omer day ${omerDay}`);
63
+ }
64
+ }
65
+ function getWeeks(omerDay) {
66
+ const weekNum = Math.floor((omerDay - 1) / 7) + 1;
67
+ const daysWithinWeeks = omerDay % 7 || 7;
68
+ return [weekNum, daysWithinWeeks];
69
+ }
70
+ function omerTodayIsEn(omerDay) {
71
+ const [weekNumber, daysWithinWeeks] = getWeeks(omerDay);
72
+ const totalDaysStr = omerDay === 1 ? 'day' : 'days';
73
+ let str = `Today is ${omerDay} ${totalDaysStr}`;
74
+ if (weekNumber > 1 || omerDay === 7) {
75
+ const day7 = daysWithinWeeks === 7;
76
+ const numWeeks = day7 ? weekNumber : weekNumber - 1;
77
+ const weeksStr = numWeeks === 1 ? 'week' : 'weeks';
78
+ str += `, which is ${numWeeks} ${weeksStr}`;
79
+ if (!day7) {
80
+ const daysStr = daysWithinWeeks === 1 ? 'day' : 'days';
81
+ str += ` and ${daysWithinWeeks} ${daysStr}`;
82
+ }
83
+ }
84
+ return str + ' of the Omer';
85
+ }
86
+ // adapted from pip hdate package (GPL)
87
+ // https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py
88
+ const tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];
89
+ const ones = [
90
+ '',
91
+ 'אֶחָד',
92
+ 'שְׁנַיִם',
93
+ 'שְׁלוֹשָׁה',
94
+ 'אַרְבָּעָה',
95
+ 'חֲמִשָּׁה',
96
+ 'שִׁשָּׁה',
97
+ 'שִׁבְעָה',
98
+ 'שְׁמוֹנָה',
99
+ 'תִּשְׁעָה',
100
+ ];
101
+ const shnei = 'שְׁנֵי';
102
+ const yamim = 'יָמִים';
103
+ const shneiYamim = shnei + ' ' + yamim;
104
+ const shavuot = 'שָׁבוּעוֹת';
105
+ const yom = 'יוֹם';
106
+ const yomEchad = yom + ' ' + ones[1];
107
+ const asar = 'עָשָׂר';
108
+ function omerTodayIsHe(omerDay) {
109
+ const ten = Math.floor(omerDay / 10);
110
+ const one = omerDay % 10;
111
+ let str = 'הַיּוֹם ';
112
+ if (omerDay === 11) {
113
+ str += 'אַחַד ' + asar;
114
+ }
115
+ else if (omerDay === 12) {
116
+ str += 'שְׁנֵים ' + asar;
117
+ }
118
+ else if (12 < omerDay && omerDay < 20) {
119
+ str += ones[one] + ' ' + asar;
120
+ }
121
+ else if (omerDay > 9) {
122
+ str += ones[one];
123
+ if (one) {
124
+ str += ' ';
125
+ str += ten === 3 ? 'וּ' : 'וְ';
126
+ }
127
+ }
128
+ if (omerDay > 2) {
129
+ if (omerDay > 20 || omerDay === 10 || omerDay === 20) {
130
+ str += tens[ten];
131
+ }
132
+ if (omerDay < 11) {
133
+ str += ones[one] + ' ' + yamim + ' ';
134
+ }
135
+ else {
136
+ str += ' ' + yom + ' ';
137
+ }
138
+ }
139
+ else if (omerDay === 1) {
140
+ str += yomEchad + ' ';
141
+ }
142
+ else {
143
+ // omer == 2
144
+ str += shneiYamim + ' ';
145
+ }
146
+ if (omerDay > 6) {
147
+ str = str.trim(); // remove trailing space before comma
148
+ str += ', שֶׁהֵם ';
149
+ const weeks = Math.floor(omerDay / 7);
150
+ const days = omerDay % 7;
151
+ if (weeks > 2) {
152
+ str += ones[weeks] + ' ' + shavuot + ' ';
153
+ }
154
+ else if (weeks === 1) {
155
+ str += 'שָׁבֽוּעַ' + ' ' + ones[1] + ' ';
156
+ }
157
+ else {
158
+ // weeks == 2
159
+ str += shnei + ' ' + shavuot + ' ';
160
+ }
161
+ if (days) {
162
+ if (days === 2 || days === 3) {
163
+ str += 'וּ';
164
+ }
165
+ else if (days === 5) {
166
+ str += 'וַ';
167
+ }
168
+ else {
169
+ str += 'וְ';
170
+ }
171
+ if (days > 2) {
172
+ str += ones[days] + ' ' + yamim + ' ';
173
+ }
174
+ else if (days === 1) {
175
+ str += yomEchad + ' ';
176
+ }
177
+ else {
178
+ // days == 2
179
+ str += shneiYamim + ' ';
180
+ }
181
+ }
182
+ }
183
+ str += 'לָעֽוֹמֶר';
184
+ return str.normalize();
185
+ }
186
+ /** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */
187
+ export class OmerEvent extends Event {
188
+ /**
189
+ * @param date
190
+ * @param omerDay
191
+ */
192
+ constructor(date, omerDay) {
193
+ super(date, `Omer ${omerDay}`, flags.OMER_COUNT);
194
+ checkDay(omerDay);
195
+ this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;
196
+ this.daysWithinWeeks = omerDay % 7 || 7;
197
+ this.omer = omerDay;
198
+ }
199
+ /**
200
+ * Returns the sefira. For example, on day 8:
201
+ * * חֶֽסֶד שֶׁבִּגְבוּרָה
202
+ * * Chesed shebiGevurah
203
+ * * Lovingkindness within Might
204
+ * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)
205
+ * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`
206
+ */
207
+ sefira(lang = 'en') {
208
+ if (lang !== 'he' && lang !== 'translit') {
209
+ lang = 'en';
210
+ }
211
+ const [weekNum, daysWithinWeeks] = getWeeks(this.omer);
212
+ const config = sefirot[lang];
213
+ const pfxWords = config.pfxWords;
214
+ const words = config.words;
215
+ const week = pfxWords ? pfxWords[weekNum] : words[weekNum];
216
+ const dayWithinWeek = words[daysWithinWeeks];
217
+ const infix = pfxWords
218
+ ? ''
219
+ : weekNum === 2 || weekNum === 6
220
+ ? config.infix26
221
+ : config.infix;
222
+ return (dayWithinWeek + ' ' + infix + week).normalize();
223
+ }
224
+ /**
225
+ * @param [locale] Optional locale name (defaults to empty locale)
226
+ */
227
+ render(locale) {
228
+ locale = locale !== null && locale !== void 0 ? locale : 'en';
229
+ if (typeof locale === 'string') {
230
+ locale = locale.toLowerCase();
231
+ }
232
+ const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
233
+ const omer = this.omer;
234
+ const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);
235
+ return nth + ' ' + Locale.gettext('day of the Omer', locale);
236
+ }
237
+ /**
238
+ * Returns translation of "Omer day 22" without ordinal numbers.
239
+ * @param [locale] Optional locale name (defaults to empty locale)
240
+ */
241
+ renderBrief(locale) {
242
+ return (Locale.gettext('Omer', locale) +
243
+ ' ' +
244
+ Locale.gettext('day', locale) +
245
+ ' ' +
246
+ this.omer);
247
+ }
248
+ /**
249
+ * Returns an emoji number symbol with a circle, for example `㊲`
250
+ * from the “Enclosed CJK Letters and Months” block of the Unicode standard
251
+ * @returns a single Unicode character from `①` through `㊾`
252
+ */
253
+ getEmoji() {
254
+ if (typeof this.emoji === 'string')
255
+ return this.emoji;
256
+ let codePoint;
257
+ const omerDay = this.omer;
258
+ if (omerDay <= 20) {
259
+ codePoint = 9312 + omerDay - 1;
260
+ }
261
+ else if (omerDay <= 35) {
262
+ // between 21 and 35 inclusive
263
+ codePoint = 12881 + omerDay - 21;
264
+ }
265
+ else {
266
+ // between 36 and 49 inclusive
267
+ codePoint = 12977 + omerDay - 36;
268
+ }
269
+ return String.fromCodePoint(codePoint);
270
+ }
271
+ getWeeks() {
272
+ const day7 = this.daysWithinWeeks === 7;
273
+ return day7 ? this.weekNumber : this.weekNumber - 1;
274
+ }
275
+ getDaysWithinWeeks() {
276
+ return this.daysWithinWeeks;
277
+ }
278
+ /**
279
+ * Returns a sentence with that evening's omer count
280
+ * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
281
+ * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
282
+ */
283
+ getTodayIs(locale) {
284
+ locale = locale !== null && locale !== void 0 ? locale : 'en';
285
+ if (typeof locale === 'string') {
286
+ locale = locale.toLowerCase();
287
+ }
288
+ const isHebrew = locale === 'he' || locale === 'he-x-nonikud';
289
+ const str = isHebrew ? omerTodayIsHe(this.omer) : omerTodayIsEn(this.omer);
290
+ if (locale === 'he-x-nonikud') {
291
+ return Locale.hebrewStripNikkud(str);
292
+ }
293
+ return str;
294
+ }
295
+ url() {
296
+ const year = this.getDate().getFullYear();
297
+ if (year < 3860 || year > 6759) {
298
+ return undefined;
299
+ }
300
+ return `https://www.hebcal.com/omer/${year}/${this.omer}`;
301
+ }
302
+ }
@@ -0,0 +1,2 @@
1
+ /** @private */
2
+ export declare function renderParshaName(parsha: string[], locale?: string): string;
@@ -0,0 +1,13 @@
1
+ import { Locale } from './locale';
2
+ /** @private */
3
+ export function renderParshaName(parsha, locale) {
4
+ const locale0 = locale !== null && locale !== void 0 ? locale : 'en';
5
+ let name = Locale.gettext(parsha[0], locale0);
6
+ if (parsha.length === 2) {
7
+ const hyphen = locale0 === 'he' ? '־' : '-';
8
+ name += hyphen + Locale.gettext(parsha[1], locale0);
9
+ }
10
+ name = name.replace(/'/g, '’');
11
+ const str = Locale.gettext('Parashat', locale) + ' ' + name;
12
+ return str.normalize();
13
+ }
@@ -0,0 +1,9 @@
1
+ import { ParshaEvent } from './ParshaEvent';
2
+ /**
3
+ * Calculates weekly Torah Reading on Saturdays for entire year
4
+ * @param year Hebrew year
5
+ * @param il Israel (false for Diaspora)
6
+ * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
7
+ * (non-holiday) Parashat HaShavua
8
+ */
9
+ export declare function parshaYear(year: number, il: boolean): ParshaEvent[];
@@ -0,0 +1,24 @@
1
+ import { HDate, months } from '@hebcal/hdate';
2
+ import { ParshaEvent } from './ParshaEvent';
3
+ import { getSedra } from './sedra';
4
+ /**
5
+ * Calculates weekly Torah Reading on Saturdays for entire year
6
+ * @param year Hebrew year
7
+ * @param il Israel (false for Diaspora)
8
+ * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
9
+ * (non-holiday) Parashat HaShavua
10
+ */
11
+ export function parshaYear(year, il) {
12
+ const sedra = getSedra(year, il);
13
+ const startAbs = sedra.getFirstSaturday();
14
+ const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);
15
+ const events = [];
16
+ for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {
17
+ const parsha = sedra.lookup(absDt);
18
+ if (!parsha.chag) {
19
+ const ev = new ParshaEvent(parsha);
20
+ events.push(ev);
21
+ }
22
+ }
23
+ return events;
24
+ }
@@ -0,0 +1,2 @@
1
+ /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
+ export declare const version = "6.0.7";
@@ -0,0 +1,2 @@
1
+ /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
+ export const version = '6.0.7';
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,48 @@
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
+ var _a;
23
+ if (typeof timeStr !== 'string')
24
+ throw new TypeError(`Bad timeStr: ${timeStr}`);
25
+ const cc = ((_a = options === null || options === void 0 ? void 0 : options.location) === null || _a === void 0 ? void 0 : _a.getCountryCode()) || ((options === null || options === void 0 ? void 0 : options.il) ? 'IL' : 'US');
26
+ const hour12 = options === null || options === void 0 ? void 0 : options.hour12;
27
+ if (typeof hour12 !== 'undefined' && !hour12) {
28
+ return timeStr;
29
+ }
30
+ if (!hour12 && typeof hour12cc[cc] === 'undefined') {
31
+ return timeStr;
32
+ }
33
+ const hm = timeStr.split(':');
34
+ let hour = parseInt(hm[0], 10);
35
+ if (hour < 12 && suffix) {
36
+ suffix = suffix.replace('p', 'a').replace('P', 'A');
37
+ if (hour === 0) {
38
+ hour = 12;
39
+ }
40
+ }
41
+ else if (hour > 12) {
42
+ hour = hour % 12;
43
+ }
44
+ else if (hour === 0) {
45
+ hour = '00';
46
+ }
47
+ return `${hour}:${hm[1]}${suffix}`;
48
+ }