@hebcal/core 5.9.0 → 5.9.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.
- package/dist/MevarchimChodeshEvent.d.ts +2 -1
- package/dist/bundle.js +2171 -2380
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +21 -21
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +5 -5
- package/dist/esm/HebrewDateEvent.js.map +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.d.ts +2 -1
- package/dist/esm/MevarchimChodeshEvent.js +5 -4
- package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
- package/dist/esm/ParshaEvent.js +1 -1
- package/dist/esm/TimedEvent.js +1 -1
- package/dist/esm/YomKippurKatanEvent.js +1 -1
- package/dist/esm/ashkenazi.po.js +1 -1
- package/dist/esm/calendar.js +11 -6
- package/dist/esm/calendar.js.map +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/event.js +1 -1
- package/dist/esm/getStartAndEnd.js +2 -2
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he.po.js +1 -1
- package/dist/esm/hebcal.js +1 -1
- package/dist/esm/holidays.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/locale.js +1 -1
- package/dist/esm/location.js +1 -1
- package/dist/esm/modern.js +1 -1
- package/dist/esm/molad.js +9 -5
- package/dist/esm/molad.js.map +1 -1
- package/dist/esm/omer.js +3 -3
- package/dist/esm/omer.js.map +1 -1
- package/dist/esm/parshaName.js +2 -2
- package/dist/esm/parshaName.js.map +1 -1
- package/dist/esm/parshaYear.js +1 -1
- package/dist/esm/pkgVersion.d.ts +1 -1
- package/dist/esm/pkgVersion.js +2 -2
- package/dist/esm/pkgVersion.js.map +1 -1
- package/dist/esm/reformatTimeStr.js +3 -3
- package/dist/esm/reformatTimeStr.js.map +1 -1
- package/dist/esm/sedra.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/index.cjs +31 -21
- package/dist/index.cjs.map +1 -1
- package/dist/pkgVersion.d.ts +1 -1
- package/package.json +17 -17
package/dist/esm/molad.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"molad.js","sources":["../../../src/molad.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, molad, Molad as MoladBase} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst shortDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n];\
|
|
1
|
+
{"version":3,"file":"molad.js","sources":["../../../src/molad.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, molad, Molad as MoladBase} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst shortDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n];\nconst frDayNames = ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'];\nconst night = 'בַּלַּ֥יְלָה';\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n else if (hour < 12) return 'בַּבֹּקֶר';\n else if (hour < 17) return 'בַּצׇּהֳרַיִים';\n else if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a molad, the moment when the new moon is \"born\"\n */\nexport class Molad {\n private readonly m: MoladBase;\n /**\n * Calculates the molad for a Hebrew month\n * @param year\n * @param month\n */\n constructor(year: number, month: number) {\n this.m = molad(year, month);\n }\n /**\n */\n getYear(): number {\n return this.m.year;\n }\n /**\n */\n getMonth(): number {\n return this.m.month;\n }\n /**\n */\n getMonthName(): string {\n return HDate.getMonthName(this.m.month, this.m.year);\n }\n /**\n * @returns Day of Week (0=Sunday, 6=Saturday)\n */\n getDow(): number {\n return this.m.dayOfWeek;\n }\n /**\n * @returns hour of day (0-23)\n */\n getHour(): number {\n return this.m.hour;\n }\n /**\n * @returns minutes past hour (0-59)\n */\n getMinutes(): number {\n return this.m.minutes;\n }\n /**\n * @returns parts of a minute (0-17)\n */\n getChalakim(): number {\n return this.m.chalakim;\n }\n /**\n * @param [locale] Optional locale name (defaults to active locale)\n * @param options\n */\n render(locale?: string, options?: CalOptions): string {\n locale = locale ?? Locale.getLocaleName();\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\n const isFrenchLocale = locale === 'fr';\n const monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = isHebrewLocale ? heDayNames : (isFrenchLocale ? frDayNames : shortDayNames);\n const dow = dayNames[this.getDow()];\n const minutes = this.getMinutes();\n const hour = this.getHour();\n const chalakim = this.getChalakim();\n const moladStr = Locale.gettext('Molad', locale);\n const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';\n const chalakimStr = Locale.gettext('chalakim', locale);\n const and = Locale.gettext('and', locale);\n const after = Locale.gettext('after', locale);\n if (isHebrewLocale) {\n const ampm = getHebrewTimeOfDay(hour);\n const result =\n `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +\n `בְּשָׁעָה ${hour} ${ampm}, ` +\n `ו-${minutes} ${minutesStr} ` +\n `ו-${chalakim} ${chalakimStr}`;\n if (locale === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(result);\n }\n return result;\n }\n const fmtTime = reformatTimeStr(`${hour}:00`, 'pm', options);\n const month = monthName.replace(/'/g, '’');\n return `${moladStr} ${month}: ${dow}, ${minutes} ${minutesStr} ${and} ${chalakim} ${chalakimStr} ${after} ${fmtTime}`;\n }\n}\n\n/** Represents a Molad announcement on Shabbat Mevarchim */\nexport class MoladEvent extends Event {\n readonly molad: Molad;\n private readonly options: CalOptions;\n /**\n * @param date Hebrew date event occurs\n * @param hyear molad year\n * @param hmonth molad month\n * @param options\n */\n constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions) {\n const m = new Molad(hyear, hmonth);\n const monthName = m.getMonthName();\n super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);\n this.molad = m;\n this.options = options;\n }\n /**\n * @param [locale] Optional locale name (defaults to active locale).\n */\n render(locale?: string): string {\n return this.molad.render(locale, this.options);\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;AAOA,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AACvE,MAAM,UAAU,GAAG;IACjB,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,WAAW;IACX,WAAW;IACX,SAAS;CACV;AACD,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;AACpE,MAAM,KAAK,GAAG,cAAc;AAE5B,SAAS,kBAAkB,CAAC,IAAY,EAAA;IACtC,IAAI,IAAI,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;SACrB,IAAI,IAAI,GAAG,EAAE;AAAE,Q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CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;;AAEjD;;;;"}
|
package/dist/esm/omer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { omerSefira, Locale, gematriya, omerEmoji, omerTodayIs } from '@hebcal/hdate';
|
|
3
3
|
import { Event, flags } from './event.js';
|
|
4
4
|
import './locale.js';
|
|
@@ -32,7 +32,7 @@ class OmerEvent extends Event {
|
|
|
32
32
|
* @param [locale] Optional locale name (defaults to active locale).
|
|
33
33
|
*/
|
|
34
34
|
render(locale) {
|
|
35
|
-
locale = locale !== null && locale !==
|
|
35
|
+
locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
|
|
36
36
|
if (typeof locale === 'string') {
|
|
37
37
|
locale = locale.toLowerCase();
|
|
38
38
|
}
|
|
@@ -68,7 +68,7 @@ class OmerEvent extends Event {
|
|
|
68
68
|
* @param locale
|
|
69
69
|
*/
|
|
70
70
|
getTodayIs(locale) {
|
|
71
|
-
locale = locale !== null && locale !==
|
|
71
|
+
locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
|
|
72
72
|
if (typeof locale === 'string') {
|
|
73
73
|
locale = locale.toLowerCase();
|
|
74
74
|
}
|
package/dist/esm/omer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omer.js","sources":["../../../src/omer.ts"],"sourcesContent":["import {\n HDate,\n Locale,\n OmerLang,\n gematriya,\n omerEmoji,\n omerSefira,\n omerTodayIs,\n} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n emoji?: string;\n\n /**\n * @param date\n * @param omerDay\n */\n constructor(date: HDate, omerDay: number) {\n super(date, `Omer ${omerDay}`, flags.OMER_COUNT);\n if (omerDay < 1 || omerDay > 49) {\n throw new RangeError(`Invalid Omer day ${omerDay}`);\n }\n this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;\n this.daysWithinWeeks = omerDay % 7 || 7;\n this.omer = omerDay;\n }\n /**\n * @param lang\n */\n sefira(lang = 'en'): string {\n if (lang !== 'he' && lang !== 'translit') {\n lang = 'en';\n }\n return omerSefira(this.omer, lang as OmerLang);\n }\n /**\n * @todo use gettext()\n * @param [locale] Optional locale name (defaults to active locale).\n */\n render(locale?: string): string {\n locale = locale ?? Locale.getLocaleName();\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\n const omer = this.omer;\n const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);\n return nth + ' ' + Locale.gettext('day of the Omer', locale);\n }\n /**\n * Returns translation of \"Omer day 22\" without ordinal numbers.\n * @param [locale] Optional locale name (defaults to active locale).\n */\n renderBrief(locale?: string): string {\n return (\n Locale.gettext('Omer', locale) +\n ' ' +\n Locale.gettext('day', locale) +\n ' ' +\n this.omer\n );\n }\n\n getEmoji(): string {\n if (typeof this.emoji === 'string') return this.emoji;\n return omerEmoji(this.omer);\n }\n\n getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * @param locale\n */\n getTodayIs(locale: string): string {\n locale = locale ?? Locale.getLocaleName();\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const omerLang = locale === 'he' || locale === 'he-x-nonikud' ? 'he' : 'en';\n const str = omerTodayIs(this.omer, omerLang) as string;\n if (locale === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(str);\n }\n return str;\n }\n\n url(): string {\n return `https://www.hebcal.com/omer/${this.getDate().getFullYear()}/${this.omer}`;\n }\n}\n"],"names":[],"mappings":";;;;;AAYA;AACM,MAAO,SAAU,SAAQ,KAAK,CAAA;AAMlC;;;AAGG;IACH,WAAY,CAAA,IAAW,EAAE,OAAe,EAAA;QACtC,KAAK,CAAC,IAAI,EAAE,CAAQ,KAAA,EAAA,OAAO,CAAE,CAAA,EAAE,KAAK,CAAC,UAAU,CAAC;QAChD,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,EAAE,EAAE;AAC/B,YAAA,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,CAAA,CAAE,CAAC;;AAErD,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QACnD,IAAI,CAAC,eAAe,GAAG,OAAO,GAAG,CAAC,IAAI,CAAC;AACvC,QAAA,IAAI,CAAC,IAAI,GAAG,OAAO;;AAErB;;AAEG;IACH,MAAM,CAAC,IAAI,GAAG,IAAI,EAAA;QAChB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,UAAU,EAAE;YACxC,IAAI,GAAG,IAAI;;QAEb,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAgB,CAAC;;AAEhD;;;AAGG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;QACpB,MAAM,GAAG,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,
|
|
1
|
+
{"version":3,"file":"omer.js","sources":["../../../src/omer.ts"],"sourcesContent":["import {\n HDate,\n Locale,\n OmerLang,\n gematriya,\n omerEmoji,\n omerSefira,\n omerTodayIs,\n} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n emoji?: string;\n\n /**\n * @param date\n * @param omerDay\n */\n constructor(date: HDate, omerDay: number) {\n super(date, `Omer ${omerDay}`, flags.OMER_COUNT);\n if (omerDay < 1 || omerDay > 49) {\n throw new RangeError(`Invalid Omer day ${omerDay}`);\n }\n this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;\n this.daysWithinWeeks = omerDay % 7 || 7;\n this.omer = omerDay;\n }\n /**\n * @param lang\n */\n sefira(lang = 'en'): string {\n if (lang !== 'he' && lang !== 'translit') {\n lang = 'en';\n }\n return omerSefira(this.omer, lang as OmerLang);\n }\n /**\n * @todo use gettext()\n * @param [locale] Optional locale name (defaults to active locale).\n */\n render(locale?: string): string {\n locale = locale ?? Locale.getLocaleName();\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\n const omer = this.omer;\n const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);\n return nth + ' ' + Locale.gettext('day of the Omer', locale);\n }\n /**\n * Returns translation of \"Omer day 22\" without ordinal numbers.\n * @param [locale] Optional locale name (defaults to active locale).\n */\n renderBrief(locale?: string): string {\n return (\n Locale.gettext('Omer', locale) +\n ' ' +\n Locale.gettext('day', locale) +\n ' ' +\n this.omer\n );\n }\n\n getEmoji(): string {\n if (typeof this.emoji === 'string') return this.emoji;\n return omerEmoji(this.omer);\n }\n\n getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * @param locale\n */\n getTodayIs(locale: string): string {\n locale = locale ?? Locale.getLocaleName();\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const omerLang = locale === 'he' || locale === 'he-x-nonikud' ? 'he' : 'en';\n const str = omerTodayIs(this.omer, omerLang) as string;\n if (locale === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(str);\n }\n return str;\n }\n\n url(): string {\n return `https://www.hebcal.com/omer/${this.getDate().getFullYear()}/${this.omer}`;\n }\n}\n"],"names":[],"mappings":";;;;;AAYA;AACM,MAAO,SAAU,SAAQ,KAAK,CAAA;AAMlC;;;AAGG;IACH,WAAY,CAAA,IAAW,EAAE,OAAe,EAAA;QACtC,KAAK,CAAC,IAAI,EAAE,CAAQ,KAAA,EAAA,OAAO,CAAE,CAAA,EAAE,KAAK,CAAC,UAAU,CAAC;QAChD,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,EAAE,EAAE;AAC/B,YAAA,MAAM,IAAI,UAAU,CAAC,oBAAoB,OAAO,CAAA,CAAE,CAAC;;AAErD,QAAA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QACnD,IAAI,CAAC,eAAe,GAAG,OAAO,GAAG,CAAC,IAAI,CAAC;AACvC,QAAA,IAAI,CAAC,IAAI,GAAG,OAAO;;AAErB;;AAEG;IACH,MAAM,CAAC,IAAI,GAAG,IAAI,EAAA;QAChB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,UAAU,EAAE;YACxC,IAAI,GAAG,IAAI;;QAEb,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAgB,CAAC;;AAEhD;;;AAGG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;QACpB,MAAM,GAAG,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,MAAA,GAAN,MAAM,GAAI,MAAM,CAAC,aAAa,EAAE;AACzC,QAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,YAAA,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE;;AAE/B,QAAA,MAAM,cAAc,GAClB,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,cAAc,IAAI,MAAM,KAAK,GAAG;AAChE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AC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAW;AACtD,QAAA,IAAI,MAAM,KAAK,cAAc,EAAE;AAC7B,YAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC;;AAEtC,QAAA,OAAO,GAAG;;IAGZ,GAAG,GAAA;AACD,QAAA,OAAO,CAA+B,4BAAA,EAAA,IAAI,CAAC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAI,CAAA,EAAA,IAAI,CAAC,IAAI,EAAE;;AAEpF;;;;"}
|
package/dist/esm/parshaName.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import './locale.js';
|
|
3
3
|
import { Locale } from '@hebcal/hdate';
|
|
4
4
|
|
|
5
5
|
/** @private */
|
|
6
6
|
function renderParshaName(parsha, locale) {
|
|
7
|
-
const locale0 = locale !== null && locale !==
|
|
7
|
+
const locale0 = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
|
|
8
8
|
let name = Locale.gettext(parsha[0], locale0);
|
|
9
9
|
if (parsha.length === 2) {
|
|
10
10
|
const hyphen = locale0 === 'he' ? '־' : '-';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parshaName.js","sources":["../../../src/parshaName.ts"],"sourcesContent":["import {Locale} from './locale';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n const locale0 = locale ?? Locale.getLocaleName();\n let name = Locale.gettext(parsha[0], locale0);\n if (parsha.length === 2) {\n const hyphen = locale0 === 'he' ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale0);\n }\n name = name.replace(/'/g, '’');\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n"],"names":[],"mappings":";;;;AAEA;AACgB,SAAA,gBAAgB,CAAC,MAAgB,EAAE,MAAe,EAAA;AAChE,IAAA,MAAM,OAAO,GAAG,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,
|
|
1
|
+
{"version":3,"file":"parshaName.js","sources":["../../../src/parshaName.ts"],"sourcesContent":["import {Locale} from './locale';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n const locale0 = locale ?? Locale.getLocaleName();\n let name = Locale.gettext(parsha[0], locale0);\n if (parsha.length === 2) {\n const hyphen = locale0 === 'he' ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale0);\n }\n name = name.replace(/'/g, '’');\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n"],"names":[],"mappings":";;;;AAEA;AACgB,SAAA,gBAAgB,CAAC,MAAgB,EAAE,MAAe,EAAA;AAChE,IAAA,MAAM,OAAO,GAAG,MAAM,KAAA,IAAA,IAAN,MAAM,KAAA,MAAA,GAAN,MAAM,GAAI,MAAM,CAAC,aAAa,EAAE;AAChD,IAAA,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AAC7C,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,QAAA,MAAM,MAAM,GAAG,OAAO,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG;AAC3C,QAAA,IAAI,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;;IAErD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC9B,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI;AAC3D,IAAA,OAAO,GAAG,CAAC,SAAS,EAAE;AACxB;;;;"}
|
package/dist/esm/parshaYear.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { ParshaEvent } from './ParshaEvent.js';
|
|
4
4
|
import { getSedra } from './sedra.js';
|
package/dist/esm/pkgVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export declare const version = "5.9.
|
|
2
|
+
export declare const version = "5.9.2";
|
package/dist/esm/pkgVersion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
3
|
-
const version = '5.9.
|
|
3
|
+
const version = '5.9.2';
|
|
4
4
|
|
|
5
5
|
export { version };
|
|
6
6
|
//# sourceMappingURL=pkgVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '5.9.
|
|
1
|
+
{"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '5.9.2';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
const hour12cc = {
|
|
3
3
|
US: 1,
|
|
4
4
|
CA: 1,
|
|
@@ -23,8 +23,8 @@ function reformatTimeStr(timeStr, suffix, options) {
|
|
|
23
23
|
var _a;
|
|
24
24
|
if (typeof timeStr !== 'string')
|
|
25
25
|
throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
26
|
-
const cc = ((_a = options === null || options ===
|
|
27
|
-
const hour12 = options === null || options ===
|
|
26
|
+
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');
|
|
27
|
+
const hour12 = options === null || options === void 0 ? void 0 : options.hour12;
|
|
28
28
|
if (typeof hour12 !== 'undefined' && !hour12) {
|
|
29
29
|
return timeStr;
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reformatTimeStr.js","sources":["../../../src/reformatTimeStr.ts"],"sourcesContent":["import {CalOptions} from './CalOptions';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * @private\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string')\n throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (typeof hour12 !== 'undefined' && !hour12) {\n return timeStr;\n }\n if (!hour12 && typeof hour12cc[cc] === 'undefined') {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,GAA2B;AACvC,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACG;AAEV;;;;;AAKG;SACa,eAAe,CAC7B,OAAe,EACf,MAAc,EACd,OAAoB,EAAA;;IAEpB,IAAI,OAAO,OAAO,KAAK,QAAQ;AAC7B,QAAA,MAAM,IAAI,SAAS,CAAC,gBAAgB,OAAO,CAAA,CAAE,CAAC;AAChD,IAAA,MAAM,EAAE,GAAG,CAAA,CAAA,EAAA,GAAA,OAAO,KAAP,IAAA,IAAA,OAAO,KAAP,
|
|
1
|
+
{"version":3,"file":"reformatTimeStr.js","sources":["../../../src/reformatTimeStr.ts"],"sourcesContent":["import {CalOptions} from './CalOptions';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * @private\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string')\n throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (typeof hour12 !== 'undefined' && !hour12) {\n return timeStr;\n }\n if (!hour12 && typeof hour12cc[cc] === 'undefined') {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,GAA2B;AACvC,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACG;AAEV;;;;;AAKG;SACa,eAAe,CAC7B,OAAe,EACf,MAAc,EACd,OAAoB,EAAA;;IAEpB,IAAI,OAAO,OAAO,KAAK,QAAQ;AAC7B,QAAA,MAAM,IAAI,SAAS,CAAC,gBAAgB,OAAO,CAAA,CAAE,CAAC;AAChD,IAAA,MAAM,EAAE,GAAG,CAAA,CAAA,EAAA,GAAA,OAAO,KAAP,IAAA,IAAA,OAAO,KAAP,MAAA,GAAA,MAAA,GAAA,OAAO,CAAE,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,cAAc,EAAE,MAAK,CAAA,OAAO,KAAP,IAAA,IAAA,OAAO,KAAP,MAAA,GAAA,MAAA,GAAA,OAAO,CAAE,EAAE,IAAG,IAAI,GAAG,IAAI,CAAC;IAC7E,MAAM,MAAM,GAAG,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,MAAA,GAAA,MAAA,GAAA,OAAO,CAAE,MAAM;IAC9B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,EAAE;AAC5C,QAAA,OAAO,OAAO;;IAEhB,IAAI,CAAC,MAAM,IAAI,OAAO,QAAQ,CAAC,EAAE,CAAC,KAAK,WAAW,EAAE;AAClD,QAAA,OAAO,OAAO;;IAEhB,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAI,IAAI,GAAoB,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/C,IAAA,IAAI,IAAI,GAAG,EAAE,IAAI,MAAM,EAAE;AACvB,QAAA,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AACnD,QAAA,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,IAAI,GAAG,EAAE;;;AAEN,SAAA,IAAI,IAAI,GAAG,EAAE,EAAE;AACpB,QAAA,IAAI,GAAG,IAAI,GAAG,EAAE;;AACX,SAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,IAAI,GAAG,IAAI;;IAEb,OAAO,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,EAAE,CAAC,CAAC,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE;AACpC;;;;"}
|
package/dist/esm/sedra.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { renderParshaName } from './parshaName.js';
|
|
4
4
|
import QuickLRU from 'quick-lru';
|
package/dist/esm/tachanun.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import { HDate, months } from '@hebcal/hdate';
|
|
3
3
|
import { dateYomHaZikaron } from './modern.js';
|
|
4
4
|
|
package/dist/esm/zmanim.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
import 'temporal-polyfill/global';
|
|
3
3
|
import { NOAACalculator } from '@hebcal/noaa';
|
|
4
4
|
import { getTimezoneOffset, pad2, getPseudoISO, HDate, isDate } from '@hebcal/hdate';
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.9.
|
|
1
|
+
/*! @hebcal/core v5.9.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var hdate = require('@hebcal/hdate');
|
|
@@ -6,7 +6,7 @@ var noaa = require('@hebcal/noaa');
|
|
|
6
6
|
require('temporal-polyfill/global');
|
|
7
7
|
|
|
8
8
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
9
|
-
const version = '5.9.
|
|
9
|
+
const version = '5.9.2';
|
|
10
10
|
|
|
11
11
|
var poAshkenazi = { "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"], "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)"], "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"], "Alot HaShachar": ["Alos HaShachar"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot hayom": ["Chatzos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"], "Birkat Hachamah": ["Birkas Hachamah"], "Shushan Purim Katan": ["Shushan Purim Koton"] } } };
|
|
12
12
|
|
|
@@ -283,8 +283,8 @@ class HebrewDateEvent extends Event {
|
|
|
283
283
|
* console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
284
284
|
*/
|
|
285
285
|
render(locale) {
|
|
286
|
-
const locale1 = locale === null || locale ===
|
|
287
|
-
const locale0 = locale1 !== null && locale1 !==
|
|
286
|
+
const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
|
|
287
|
+
const locale0 = locale1 !== null && locale1 !== void 0 ? locale1 : hdate.Locale.getLocaleName();
|
|
288
288
|
const hd = this.getDate();
|
|
289
289
|
switch (locale0) {
|
|
290
290
|
case 'h':
|
|
@@ -317,8 +317,8 @@ class HebrewDateEvent extends Event {
|
|
|
317
317
|
* console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'
|
|
318
318
|
*/
|
|
319
319
|
renderBrief(locale) {
|
|
320
|
-
const locale1 = locale === null || locale ===
|
|
321
|
-
const locale0 = locale1 !== null && locale1 !==
|
|
320
|
+
const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
|
|
321
|
+
const locale0 = locale1 !== null && locale1 !== void 0 ? locale1 : hdate.Locale.getLocaleName();
|
|
322
322
|
const hd = this.getDate();
|
|
323
323
|
if (hd.getMonth() === hdate.months.TISHREI && hd.getDate() === 1) {
|
|
324
324
|
return this.render(locale0);
|
|
@@ -1225,8 +1225,8 @@ function reformatTimeStr(timeStr, suffix, options) {
|
|
|
1225
1225
|
var _a;
|
|
1226
1226
|
if (typeof timeStr !== 'string')
|
|
1227
1227
|
throw new TypeError(`Bad timeStr: ${timeStr}`);
|
|
1228
|
-
const cc = ((_a = options === null || options ===
|
|
1229
|
-
const hour12 = options === null || options ===
|
|
1228
|
+
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');
|
|
1229
|
+
const hour12 = options === null || options === void 0 ? void 0 : options.hour12;
|
|
1230
1230
|
if (typeof hour12 !== 'undefined' && !hour12) {
|
|
1231
1231
|
return timeStr;
|
|
1232
1232
|
}
|
|
@@ -2298,6 +2298,7 @@ const heDayNames = [
|
|
|
2298
2298
|
'שִׁישִּׁי',
|
|
2299
2299
|
'שַׁבָּת',
|
|
2300
2300
|
];
|
|
2301
|
+
const frDayNames = ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'];
|
|
2301
2302
|
const night = 'בַּלַּ֥יְלָה';
|
|
2302
2303
|
function getHebrewTimeOfDay(hour) {
|
|
2303
2304
|
if (hour < 5)
|
|
@@ -2367,20 +2368,23 @@ class Molad {
|
|
|
2367
2368
|
*/
|
|
2368
2369
|
render(locale, options) {
|
|
2369
2370
|
var _a;
|
|
2370
|
-
locale = locale !== null && locale !==
|
|
2371
|
+
locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
|
|
2371
2372
|
if (typeof locale === 'string') {
|
|
2372
2373
|
locale = locale.toLowerCase();
|
|
2373
2374
|
}
|
|
2374
2375
|
const isHebrewLocale = locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';
|
|
2376
|
+
const isFrenchLocale = locale === 'fr';
|
|
2375
2377
|
const monthName = hdate.Locale.gettext(this.getMonthName(), locale);
|
|
2376
|
-
const dayNames = isHebrewLocale ? heDayNames : shortDayNames;
|
|
2378
|
+
const dayNames = isHebrewLocale ? heDayNames : (isFrenchLocale ? frDayNames : shortDayNames);
|
|
2377
2379
|
const dow = dayNames[this.getDow()];
|
|
2378
2380
|
const minutes = this.getMinutes();
|
|
2379
2381
|
const hour = this.getHour();
|
|
2380
2382
|
const chalakim = this.getChalakim();
|
|
2381
2383
|
const moladStr = hdate.Locale.gettext('Molad', locale);
|
|
2382
|
-
const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !==
|
|
2384
|
+
const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !== void 0 ? _a : 'minutes';
|
|
2383
2385
|
const chalakimStr = hdate.Locale.gettext('chalakim', locale);
|
|
2386
|
+
const and = hdate.Locale.gettext('and', locale);
|
|
2387
|
+
const after = hdate.Locale.gettext('after', locale);
|
|
2384
2388
|
if (isHebrewLocale) {
|
|
2385
2389
|
const ampm = getHebrewTimeOfDay(hour);
|
|
2386
2390
|
const result = `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +
|
|
@@ -2394,7 +2398,7 @@ class Molad {
|
|
|
2394
2398
|
}
|
|
2395
2399
|
const fmtTime = reformatTimeStr(`${hour}:00`, 'pm', options);
|
|
2396
2400
|
const month = monthName.replace(/'/g, '’');
|
|
2397
|
-
return `${moladStr} ${month}: ${dow}, ${minutes} ${minutesStr} and ${chalakim} ${chalakimStr} after ${fmtTime}`;
|
|
2401
|
+
return `${moladStr} ${month}: ${dow}, ${minutes} ${minutesStr} ${and} ${chalakim} ${chalakimStr} ${after} ${fmtTime}`;
|
|
2398
2402
|
}
|
|
2399
2403
|
}
|
|
2400
2404
|
/** Represents a Molad announcement on Shabbat Mevarchim */
|
|
@@ -2449,7 +2453,7 @@ class OmerEvent extends Event {
|
|
|
2449
2453
|
* @param [locale] Optional locale name (defaults to active locale).
|
|
2450
2454
|
*/
|
|
2451
2455
|
render(locale) {
|
|
2452
|
-
locale = locale !== null && locale !==
|
|
2456
|
+
locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
|
|
2453
2457
|
if (typeof locale === 'string') {
|
|
2454
2458
|
locale = locale.toLowerCase();
|
|
2455
2459
|
}
|
|
@@ -2485,7 +2489,7 @@ class OmerEvent extends Event {
|
|
|
2485
2489
|
* @param locale
|
|
2486
2490
|
*/
|
|
2487
2491
|
getTodayIs(locale) {
|
|
2488
|
-
locale = locale !== null && locale !==
|
|
2492
|
+
locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
|
|
2489
2493
|
if (typeof locale === 'string') {
|
|
2490
2494
|
locale = locale.toLowerCase();
|
|
2491
2495
|
}
|
|
@@ -2503,7 +2507,7 @@ class OmerEvent extends Event {
|
|
|
2503
2507
|
|
|
2504
2508
|
/** @private */
|
|
2505
2509
|
function renderParshaName(parsha, locale) {
|
|
2506
|
-
const locale0 = locale !== null && locale !==
|
|
2510
|
+
const locale0 = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
|
|
2507
2511
|
let name = hdate.Locale.gettext(parsha[0], locale0);
|
|
2508
2512
|
if (parsha.length === 2) {
|
|
2509
2513
|
const hyphen = locale0 === 'he' ? '־' : '-';
|
|
@@ -3762,10 +3766,11 @@ class MevarchimChodeshEvent extends Event {
|
|
|
3762
3766
|
* @param date Hebrew date event occurs
|
|
3763
3767
|
* @param monthName Hebrew month name (not translated)
|
|
3764
3768
|
* @param [memo]
|
|
3769
|
+
* @param locale Optional locale name
|
|
3765
3770
|
*/
|
|
3766
|
-
constructor(date, monthName, memo) {
|
|
3771
|
+
constructor(date, monthName, memo, locale) {
|
|
3767
3772
|
super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
|
|
3768
|
-
this.monthName = monthName;
|
|
3773
|
+
this.monthName = hdate.Locale.gettext(monthName, locale);
|
|
3769
3774
|
if (memo) {
|
|
3770
3775
|
this.memo = memo;
|
|
3771
3776
|
}
|
|
@@ -4304,9 +4309,13 @@ function calendar(options = {}) {
|
|
|
4304
4309
|
}
|
|
4305
4310
|
}
|
|
4306
4311
|
const dailyLearning = options.dailyLearning;
|
|
4312
|
+
let numDailyLearning = 0;
|
|
4307
4313
|
if (typeof dailyLearning === 'object') {
|
|
4308
4314
|
const events = makeDailyLearning(hd, dailyLearning, il);
|
|
4309
|
-
|
|
4315
|
+
numDailyLearning = events.length;
|
|
4316
|
+
if (numDailyLearning) {
|
|
4317
|
+
evts.push(...events);
|
|
4318
|
+
}
|
|
4310
4319
|
}
|
|
4311
4320
|
if (options.omer && abs >= beginOmer && abs <= endOmer) {
|
|
4312
4321
|
const omer = abs - beginOmer + 1;
|
|
@@ -4334,7 +4343,8 @@ function calendar(options = {}) {
|
|
|
4334
4343
|
evts.push(candlesEv);
|
|
4335
4344
|
}
|
|
4336
4345
|
if (options.addHebrewDates ||
|
|
4337
|
-
(options.addHebrewDatesForEvents &&
|
|
4346
|
+
(options.addHebrewDatesForEvents &&
|
|
4347
|
+
prevEventsLength !== evts.length - numDailyLearning)) {
|
|
4338
4348
|
const e2 = new HebrewDateEvent(hd);
|
|
4339
4349
|
if (prevEventsLength === evts.length) {
|
|
4340
4350
|
evts.push(e2);
|
|
@@ -4523,7 +4533,7 @@ function getMaskFromOptions(options) {
|
|
|
4523
4533
|
if (typeof options.mask === 'number') {
|
|
4524
4534
|
return setOptionsFromMask(options);
|
|
4525
4535
|
}
|
|
4526
|
-
const il = options.il || ((_a = options.location) === null || _a ===
|
|
4536
|
+
const il = options.il || ((_a = options.location) === null || _a === void 0 ? void 0 : _a.getIsrael()) || false;
|
|
4527
4537
|
let mask = 0;
|
|
4528
4538
|
// default options
|
|
4529
4539
|
if (!options.noHolidays) {
|
|
@@ -4710,7 +4720,7 @@ function makeMoladAndMevarchimChodesh(hd, options) {
|
|
|
4710
4720
|
const nextMonthName = hdate.HDate.getMonthName(monNext, hyear);
|
|
4711
4721
|
const molad = new Molad(hyear, monNext);
|
|
4712
4722
|
const memo = molad.render(options.locale || 'en', options);
|
|
4713
|
-
evts.push(new MevarchimChodeshEvent(hd, nextMonthName, memo));
|
|
4723
|
+
evts.push(new MevarchimChodeshEvent(hd, nextMonthName, memo, options.locale));
|
|
4714
4724
|
}
|
|
4715
4725
|
}
|
|
4716
4726
|
return evts;
|