@hebcal/core 5.8.14 → 5.9.1

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 (49) hide show
  1. package/dist/DailyLearning.d.ts +4 -1
  2. package/dist/bundle.js +109 -93
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +4 -4
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/DailyLearning.d.ts +4 -1
  7. package/dist/esm/DailyLearning.js +18 -7
  8. package/dist/esm/DailyLearning.js.map +1 -1
  9. package/dist/esm/HebrewDateEvent.js +5 -5
  10. package/dist/esm/HebrewDateEvent.js.map +1 -1
  11. package/dist/esm/HolidayEvent.js +1 -1
  12. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  13. package/dist/esm/ParshaEvent.js +1 -1
  14. package/dist/esm/TimedEvent.js +1 -1
  15. package/dist/esm/YomKippurKatanEvent.js +1 -1
  16. package/dist/esm/ashkenazi.po.js +1 -1
  17. package/dist/esm/calendar.js +10 -5
  18. package/dist/esm/calendar.js.map +1 -1
  19. package/dist/esm/candles.js +1 -1
  20. package/dist/esm/event.js +1 -1
  21. package/dist/esm/getStartAndEnd.js +2 -2
  22. package/dist/esm/hallel.js +1 -1
  23. package/dist/esm/he.po.js +1 -1
  24. package/dist/esm/hebcal.js +1 -1
  25. package/dist/esm/holidays.js +1 -1
  26. package/dist/esm/index.js +1 -1
  27. package/dist/esm/locale.js +1 -1
  28. package/dist/esm/location.js +1 -1
  29. package/dist/esm/modern.js +1 -1
  30. package/dist/esm/molad.js +3 -3
  31. package/dist/esm/molad.js.map +1 -1
  32. package/dist/esm/omer.js +3 -3
  33. package/dist/esm/omer.js.map +1 -1
  34. package/dist/esm/parshaName.js +2 -2
  35. package/dist/esm/parshaName.js.map +1 -1
  36. package/dist/esm/parshaYear.js +1 -1
  37. package/dist/esm/pkgVersion.d.ts +1 -1
  38. package/dist/esm/pkgVersion.js +2 -2
  39. package/dist/esm/pkgVersion.js.map +1 -1
  40. package/dist/esm/reformatTimeStr.js +3 -3
  41. package/dist/esm/reformatTimeStr.js.map +1 -1
  42. package/dist/esm/sedra.js +1 -1
  43. package/dist/esm/staticHolidays.js +1 -1
  44. package/dist/esm/tachanun.js +1 -1
  45. package/dist/esm/zmanim.js +1 -1
  46. package/dist/index.cjs +38 -22
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/pkgVersion.d.ts +1 -1
  49. package/package.json +12 -12
@@ -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];\n\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 monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = isHebrewLocale ? heDayNames : 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 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;AAED,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,QAAA,OAAO,WAAW;SACjC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,gBAAgB;SACtC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,UAAU;AACrC,IAAA,OAAO,KAAK;AACd;AAEA;;AAEG;MACU,KAAK,CAAA;AAEhB;;;;AAIG;IACH,WAAY,CAAA,IAAY,EAAE,KAAa,EAAA;QACrC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;;AAE7B;AACG;IACH,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI;;AAEpB;AACG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK;;AAErB;AACG;IACH,YAAY,GAAA;AACV,QAAA,OAAO,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;;AAEtD;;AAEG;IACH,MAAM,GA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QAAA,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,EAAE;AAClC,QAAA,KAAK,CAAC,IAAI,EAAE,CAAA,MAAA,EAAS,SAAS,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,EAAE,KAAK,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,KAAK,GAAG,CAAC;AACd,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;;AAExB;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;;AAEjD;;;;"}
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];\n\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 monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = isHebrewLocale ? heDayNames : 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 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;AAED,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,QAAA,OAAO,WAAW;SACjC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,gBAAgB;SACtC,IAAI,IAAI,GAAG,EAAE;AAAE,QAAA,OAAO,UAAU;AACrC,IAAA,OAAO,KAAK;AACd;AAEA;;AAEG;MACU,KAAK,CAAA;AAEhB;;;;AAIG;IACH,WAAY,CAAA,IAAY,EAAE,KAAa,EAAA;QACrC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;;AAE7B;AACG;IACH,OAAO,GAAA;AACL,QAAA,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI;;AAEpB;AACG;IACH,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK;;AAErB;AACG;IACH,YAAY,GAAA;AACV,QAAA,OAAO,KAAK,CAAC,YAAY,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Aa,EAAE,MAAc,EAAE,OAAmB,EAAA;QACzE,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC;AAClC,QAAA,MAAM,SAAS,GAAG,CAAC,CAAC,YAAY,EAAE;AAClC,QAAA,KAAK,CAAC,IAAI,EAAE,CAAA,MAAA,EAAS,SAAS,CAAA,CAAA,EAAI,KAAK,CAAA,CAAE,EAAE,KAAK,CAAC,KAAK,CAAC;AACvD,QAAA,IAAI,CAAC,KAAK,GAAG,CAAC;AACd,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;;AAExB;;AAEG;AACH,IAAA,MAAM,CAAC,MAAe,EAAA;AACpB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;;AAEjD;;;;"}
package/dist/esm/omer.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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 !== undefined ? locale : Locale.getLocaleName();
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 !== undefined ? locale : Locale.getLocaleName();
71
+ locale = locale !== null && locale !== void 0 ? locale : Locale.getLocaleName();
72
72
  if (typeof locale === 'string') {
73
73
  locale = locale.toLowerCase();
74
74
  }
@@ -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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,IAAA,IAAN,MAAM,KAAA,SAAA,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,QAAQ,GAAG,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI;QAC3E,MAAM,GAAG,GAAG,WAAW,CAAC,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;;;;"}
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;QA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-1,10 +1,10 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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 !== undefined ? locale : Locale.getLocaleName();
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,SAAA,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;;;;"}
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;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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';
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "5.8.14";
2
+ export declare const version = "5.9.1";
@@ -1,6 +1,6 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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.8.14';
3
+ const version = '5.9.1';
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.8.14';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '5.9.1';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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 === undefined ? undefined : options.location) === null || _a === undefined ? undefined : _a.getCountryCode()) || ((options === null || options === undefined ? undefined : options.il) ? 'IL' : 'US');
27
- const hour12 = options === null || options === undefined ? undefined : options.hour12;
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,SAAA,GAAA,SAAA,GAAA,OAAO,CAAE,QAAQ,MAAE,IAAA,IAAA,EAAA,KAAA,SAAA,GAAA,SAAA,GAAA,EAAA,CAAA,cAAc,EAAE,MAAK,CAAA,OAAO,KAAP,IAAA,IAAA,OAAO,KAAP,SAAA,GAAA,SAAA,GAAA,OAAO,CAAE,EAAE,IAAG,IAAI,GAAG,IAAI,CAAC;IAC7E,MAAM,MAAM,GAAG,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,SAAA,GAAA,SAAA,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;;;;"}
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.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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.8.14, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.1, 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.8.14';
9
+ const version = '5.9.1';
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 === undefined ? undefined : locale.toLowerCase();
287
- const locale0 = locale1 !== null && locale1 !== undefined ? locale1 : hdate.Locale.getLocaleName();
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 === undefined ? undefined : locale.toLowerCase();
321
- const locale0 = locale1 !== null && locale1 !== undefined ? locale1 : hdate.Locale.getLocaleName();
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 === undefined ? undefined : options.location) === null || _a === undefined ? undefined : _a.getCountryCode()) || ((options === null || options === undefined ? undefined : options.il) ? 'IL' : 'US');
1229
- const hour12 = options === null || options === undefined ? undefined : options.hour12;
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
  }
@@ -2367,7 +2367,7 @@ class Molad {
2367
2367
  */
2368
2368
  render(locale, options) {
2369
2369
  var _a;
2370
- locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
2370
+ locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
2371
2371
  if (typeof locale === 'string') {
2372
2372
  locale = locale.toLowerCase();
2373
2373
  }
@@ -2379,7 +2379,7 @@ class Molad {
2379
2379
  const hour = this.getHour();
2380
2380
  const chalakim = this.getChalakim();
2381
2381
  const moladStr = hdate.Locale.gettext('Molad', locale);
2382
- const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !== undefined ? _a : 'minutes';
2382
+ const minutesStr = (_a = hdate.Locale.lookupTranslation('min', locale)) !== null && _a !== void 0 ? _a : 'minutes';
2383
2383
  const chalakimStr = hdate.Locale.gettext('chalakim', locale);
2384
2384
  if (isHebrewLocale) {
2385
2385
  const ampm = getHebrewTimeOfDay(hour);
@@ -2449,7 +2449,7 @@ class OmerEvent extends Event {
2449
2449
  * @param [locale] Optional locale name (defaults to active locale).
2450
2450
  */
2451
2451
  render(locale) {
2452
- locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
2452
+ locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
2453
2453
  if (typeof locale === 'string') {
2454
2454
  locale = locale.toLowerCase();
2455
2455
  }
@@ -2485,7 +2485,7 @@ class OmerEvent extends Event {
2485
2485
  * @param locale
2486
2486
  */
2487
2487
  getTodayIs(locale) {
2488
- locale = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
2488
+ locale = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
2489
2489
  if (typeof locale === 'string') {
2490
2490
  locale = locale.toLowerCase();
2491
2491
  }
@@ -2503,7 +2503,7 @@ class OmerEvent extends Event {
2503
2503
 
2504
2504
  /** @private */
2505
2505
  function renderParshaName(parsha, locale) {
2506
- const locale0 = locale !== null && locale !== undefined ? locale : hdate.Locale.getLocaleName();
2506
+ const locale0 = locale !== null && locale !== void 0 ? locale : hdate.Locale.getLocaleName();
2507
2507
  let name = hdate.Locale.gettext(parsha[0], locale0);
2508
2508
  if (parsha.length === 2) {
2509
2509
  const hyphen = locale0 === 'he' ? '־' : '-';
@@ -3800,7 +3800,6 @@ class MevarchimChodeshEvent extends Event {
3800
3800
  }
3801
3801
  }
3802
3802
 
3803
- /** @private */
3804
3803
  const cals = new Map();
3805
3804
  /**
3806
3805
  * Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.
@@ -3811,12 +3810,17 @@ class DailyLearning {
3811
3810
  /**
3812
3811
  * Register a new learning calendar.
3813
3812
  * @param name case insensitive
3813
+ * @param calendar a function that returns an `Event` or `null`
3814
+ * @param startDate the first date for which this calendar is valid
3814
3815
  */
3815
- static addCalendar(name, calendar) {
3816
+ static addCalendar(name, calendar, startDate) {
3816
3817
  if (typeof calendar !== 'function') {
3817
3818
  throw new TypeError(`Invalid calendar function: ${calendar}`);
3818
3819
  }
3819
- cals.set(name.toLowerCase(), calendar);
3820
+ cals.set(name.toLowerCase(), {
3821
+ fn: calendar,
3822
+ startDate: startDate,
3823
+ });
3820
3824
  }
3821
3825
  /**
3822
3826
  * Returns an event from daily calendar for a given date. Returns `null` if there
@@ -3826,12 +3830,19 @@ class DailyLearning {
3826
3830
  * @param il true for Israel, false for Diaspora
3827
3831
  */
3828
3832
  static lookup(name, hd, il) {
3829
- const fn = cals.get(name.toLowerCase());
3830
- if (typeof fn === 'function') {
3831
- return fn(hd, il);
3833
+ const cal = cals.get(name.toLowerCase());
3834
+ if (typeof cal === 'object') {
3835
+ return cal.fn(hd, il);
3832
3836
  }
3833
3837
  return null;
3834
3838
  }
3839
+ static getStartDate(name) {
3840
+ const cal = cals.get(name.toLowerCase());
3841
+ if (typeof cal === 'object') {
3842
+ return cal.startDate;
3843
+ }
3844
+ return undefined;
3845
+ }
3835
3846
  /**
3836
3847
  * Tests to see if learning calendar has been registered
3837
3848
  * @param name case insensitive
@@ -4293,9 +4304,13 @@ function calendar(options = {}) {
4293
4304
  }
4294
4305
  }
4295
4306
  const dailyLearning = options.dailyLearning;
4307
+ let numDailyLearning = 0;
4296
4308
  if (typeof dailyLearning === 'object') {
4297
4309
  const events = makeDailyLearning(hd, dailyLearning, il);
4298
- evts.push(...events);
4310
+ numDailyLearning = events.length;
4311
+ if (numDailyLearning) {
4312
+ evts.push(...events);
4313
+ }
4299
4314
  }
4300
4315
  if (options.omer && abs >= beginOmer && abs <= endOmer) {
4301
4316
  const omer = abs - beginOmer + 1;
@@ -4323,7 +4338,8 @@ function calendar(options = {}) {
4323
4338
  evts.push(candlesEv);
4324
4339
  }
4325
4340
  if (options.addHebrewDates ||
4326
- (options.addHebrewDatesForEvents && prevEventsLength !== evts.length)) {
4341
+ (options.addHebrewDatesForEvents &&
4342
+ prevEventsLength !== evts.length - numDailyLearning)) {
4327
4343
  const e2 = new HebrewDateEvent(hd);
4328
4344
  if (prevEventsLength === evts.length) {
4329
4345
  evts.push(e2);
@@ -4512,7 +4528,7 @@ function getMaskFromOptions(options) {
4512
4528
  if (typeof options.mask === 'number') {
4513
4529
  return setOptionsFromMask(options);
4514
4530
  }
4515
- const il = options.il || ((_a = options.location) === null || _a === undefined ? undefined : _a.getIsrael()) || false;
4531
+ const il = options.il || ((_a = options.location) === null || _a === void 0 ? void 0 : _a.getIsrael()) || false;
4516
4532
  let mask = 0;
4517
4533
  // default options
4518
4534
  if (!options.noHolidays) {