@hebcal/core 6.4.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +33 -0
  2. package/dist/bundle.js +126 -64
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +5 -5
  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.d.ts +6 -1
  11. package/dist/esm/ParshaEvent.js +7 -2
  12. package/dist/esm/ParshaEvent.js.map +1 -1
  13. package/dist/esm/TimedEvent.js +1 -1
  14. package/dist/esm/YomKippurKatanEvent.js +1 -1
  15. package/dist/esm/ashkenazi.po.js +1 -1
  16. package/dist/esm/calendar.js +1 -1
  17. package/dist/esm/candles.js +1 -1
  18. package/dist/esm/event.js +2 -2
  19. package/dist/esm/event.js.map +1 -1
  20. package/dist/esm/getStartAndEnd.js +1 -1
  21. package/dist/esm/hallel.js +1 -1
  22. package/dist/esm/he-x-NoNikud.po.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.d.ts +2 -0
  27. package/dist/esm/index.js +3 -1
  28. package/dist/esm/index.js.map +1 -1
  29. package/dist/esm/isAssurBemlacha.js +1 -1
  30. package/dist/esm/isAveilut.d.ts +11 -0
  31. package/dist/esm/isAveilut.js +42 -0
  32. package/dist/esm/isAveilut.js.map +1 -0
  33. package/dist/esm/isFastDay.d.ts +9 -0
  34. package/dist/esm/isFastDay.js +24 -0
  35. package/dist/esm/isFastDay.js.map +1 -0
  36. package/dist/esm/locale.js +1 -1
  37. package/dist/esm/location.d.ts +0 -1
  38. package/dist/esm/location.js +1 -2
  39. package/dist/esm/location.js.map +1 -1
  40. package/dist/esm/modern.js +1 -1
  41. package/dist/esm/molad.js +1 -1
  42. package/dist/esm/moladBase.js +1 -1
  43. package/dist/esm/moladDate.js +1 -1
  44. package/dist/esm/omer.js +1 -1
  45. package/dist/esm/parshaName.js +1 -1
  46. package/dist/esm/parshaYear.js +1 -1
  47. package/dist/esm/pkgVersion.d.ts +1 -1
  48. package/dist/esm/pkgVersion.js +2 -2
  49. package/dist/esm/pkgVersion.js.map +1 -1
  50. package/dist/esm/reformatTimeStr.js +1 -1
  51. package/dist/esm/sedra.js +1 -1
  52. package/dist/esm/sefira.json.js +1 -1
  53. package/dist/esm/staticHolidays.js +1 -1
  54. package/dist/esm/tachanun.js +1 -1
  55. package/dist/esm/temporal-shim.js +1 -1
  56. package/dist/esm/zmanim.js +1 -1
  57. package/dist/src/ParshaEvent.d.ts +6 -1
  58. package/dist/src/ParshaEvent.js +6 -1
  59. package/dist/src/event.js +1 -1
  60. package/dist/src/index.d.ts +2 -0
  61. package/dist/src/index.js +2 -0
  62. package/dist/src/isAveilut.d.ts +11 -0
  63. package/dist/src/isAveilut.js +37 -0
  64. package/dist/src/isFastDay.d.ts +9 -0
  65. package/dist/src/isFastDay.js +19 -0
  66. package/dist/src/location.d.ts +0 -1
  67. package/dist/src/location.js +0 -1
  68. package/dist/src/pkgVersion.d.ts +1 -1
  69. package/dist/src/pkgVersion.js +1 -1
  70. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months, HDate } from '@hebcal/hdate';
3
3
 
4
4
  const SUN = 0;
package/dist/esm/molad.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './temporal-shim.js';
3
3
  import { Event, flags } from './event.js';
4
4
  import { HDate, Locale, pad2 } from '@hebcal/hdate';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, isLeapYear } from '@hebcal/hdate';
3
3
 
4
4
  /*
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './temporal-shim.js';
3
3
  import { getTimezoneOffset } from '@hebcal/hdate';
4
4
 
package/dist/esm/omer.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Locale, gematriya } from '@hebcal/hdate';
3
3
  import { Event, flags } from './event.js';
4
4
  import './locale.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, 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
 
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, 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 = "6.4.0";
2
+ export declare const version = "6.5.0";
@@ -1,6 +1,6 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
3
- const version = '6.4.0';
3
+ const version = '6.5.0';
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 = '6.4.0';\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 = '6.5.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const hour12cc = {
3
3
  US: 1,
4
4
  CA: 1,
package/dist/esm/sedra.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import QuickLRU from 'quick-lru';
4
4
  import './locale.js';
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const ps67lines=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines,lamnatzeachLetters:lamnatzeachLetters,anaBekoach:anaBekoach};
3
3
 
4
4
  export { anaBekoach, sefira as default, lamnatzeachLetters, ps67lines };
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, 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 v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, 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 v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { Temporal } from 'temporal-polyfill';
3
3
 
4
4
  /// <reference types="temporal-polyfill/global" />
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.4.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.5.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './temporal-shim.js';
3
3
  import { NOAACalculator } from '@hebcal/noaa';
4
4
  import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
@@ -2,7 +2,12 @@ import { Event } from './event';
2
2
  import { SedraResult } from './sedra';
3
3
  import './locale';
4
4
  /**
5
- * Represents one of 54 weekly Torah portions, always on a Saturday
5
+ * Represents one of 54 weekly Torah portions, always on a Saturday.
6
+ *
7
+ * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot
8
+ * with holiday readings such as Shabbat Chol ha-Moed, use
9
+ * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from
10
+ * `@hebcal/leyning` when the display title and exact Torah readings are needed.
6
11
  */
7
12
  export declare class ParshaEvent extends Event {
8
13
  readonly p: SedraResult;
@@ -3,7 +3,12 @@ import { isoDateString } from '@hebcal/hdate';
3
3
  import { renderParshaName } from './parshaName';
4
4
  import './locale'; // Adds Hebrew and Ashkenazic translations
5
5
  /**
6
- * Represents one of 54 weekly Torah portions, always on a Saturday
6
+ * Represents one of 54 weekly Torah portions, always on a Saturday.
7
+ *
8
+ * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot
9
+ * with holiday readings such as Shabbat Chol ha-Moed, use
10
+ * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from
11
+ * `@hebcal/leyning` when the display title and exact Torah readings are needed.
7
12
  */
8
13
  export class ParshaEvent extends Event {
9
14
  p;
package/dist/src/event.js CHANGED
@@ -66,7 +66,7 @@ export const flags = {
66
66
  };
67
67
  const flagToCategory = [
68
68
  [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],
69
- [flags.CHANUKAH_CANDLES, 'holiday', 'major'],
69
+ [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],
70
70
  [flags.HEBREW_DATE, 'hebdate'],
71
71
  [flags.MINOR_FAST, 'holiday', 'fast'],
72
72
  [flags.MINOR_HOLIDAY, 'holiday', 'minor'],
@@ -9,6 +9,8 @@ export { GeoLocation, NOAACalculator } from '@hebcal/noaa';
9
9
  export { Location } from './location';
10
10
  export { Zmanim } from './zmanim';
11
11
  export { isAssurBemlacha } from './isAssurBemlacha';
12
+ export { isAveilut } from './isAveilut';
13
+ export { isFastDay } from './isFastDay';
12
14
  export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent';
13
15
  export { FastDayEvent, TimedChanukahEvent } from './candles';
14
16
  export { MoladBase, calculateMolad } from './moladBase';
package/dist/src/index.js CHANGED
@@ -8,6 +8,8 @@ export { GeoLocation, NOAACalculator } from '@hebcal/noaa';
8
8
  export { Location } from './location';
9
9
  export { Zmanim } from './zmanim';
10
10
  export { isAssurBemlacha } from './isAssurBemlacha';
11
+ export { isAveilut } from './isAveilut';
12
+ export { isFastDay } from './isFastDay';
11
13
  export { TimedEvent, CandleLightingEvent, HavdalahEvent } from './TimedEvent';
12
14
  export { FastDayEvent, TimedChanukahEvent } from './candles';
13
15
  export { calculateMolad } from './moladBase';
@@ -0,0 +1,11 @@
1
+ import { HDate } from '@hebcal/hdate';
2
+ /**
3
+ * Utility method to determine if the given date is during a mourning period.
4
+ *
5
+ * This broad helper returns `true` during Sefirat HaOmer and Bein HaMetzarim.
6
+ * It does not attempt to model minhag-specific exceptions within those periods.
7
+ *
8
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
9
+ * @return `true` if the date is during a mourning period
10
+ */
11
+ export declare function isAveilut(date: HDate | Date | number): boolean;
@@ -0,0 +1,37 @@
1
+ import { HDate, months } from '@hebcal/hdate';
2
+ const NISAN = months.NISAN;
3
+ const SIVAN = months.SIVAN;
4
+ const TAMUZ = months.TAMUZ;
5
+ const AV = months.AV;
6
+ const SAT = 6;
7
+ function getHDate(date) {
8
+ return HDate.isHDate(date) ? date : new HDate(date);
9
+ }
10
+ function isSefiratHaOmer(hd) {
11
+ const hyear = hd.getFullYear();
12
+ const beginOmer = new HDate(16, NISAN, hyear).abs();
13
+ const endOmer = new HDate(5, SIVAN, hyear).abs();
14
+ const abs = hd.abs();
15
+ return abs >= beginOmer && abs <= endOmer;
16
+ }
17
+ function isBeinHaMetzarim(hd) {
18
+ const hyear = hd.getFullYear();
19
+ const begin = new HDate(17, TAMUZ, hyear).abs();
20
+ const tishaBav = new HDate(9, AV, hyear);
21
+ const end = tishaBav.getDay() === SAT ? new HDate(10, AV, hyear).abs() : tishaBav.abs();
22
+ const abs = hd.abs();
23
+ return abs >= begin && abs <= end;
24
+ }
25
+ /**
26
+ * Utility method to determine if the given date is during a mourning period.
27
+ *
28
+ * This broad helper returns `true` during Sefirat HaOmer and Bein HaMetzarim.
29
+ * It does not attempt to model minhag-specific exceptions within those periods.
30
+ *
31
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
32
+ * @return `true` if the date is during a mourning period
33
+ */
34
+ export function isAveilut(date) {
35
+ const hd = getHDate(date);
36
+ return isSefiratHaOmer(hd) || isBeinHaMetzarim(hd);
37
+ }
@@ -0,0 +1,9 @@
1
+ import { HDate } from '@hebcal/hdate';
2
+ /**
3
+ * Utility method to determine if the given date is a fast day.
4
+ *
5
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
6
+ * @param il use the Israeli schedule for holidays
7
+ * @return `true` if the date is a major or minor fast day
8
+ */
9
+ export declare function isFastDay(date: HDate | Date | number, il?: boolean): boolean;
@@ -0,0 +1,19 @@
1
+ import { flags } from './event';
2
+ import { getHolidaysOnDate } from './holidays';
3
+ const FAST_DAY = flags.MAJOR_FAST | flags.MINOR_FAST;
4
+ const EREV = flags.EREV;
5
+ /**
6
+ * Utility method to determine if the given date is a fast day.
7
+ *
8
+ * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
9
+ * @param il use the Israeli schedule for holidays
10
+ * @return `true` if the date is a major or minor fast day
11
+ */
12
+ export function isFastDay(date, il) {
13
+ const events = getHolidaysOnDate(date, il) || [];
14
+ const fastDay = events.find(ev => {
15
+ const mask = ev.getFlags();
16
+ return mask & FAST_DAY && !(mask & EREV);
17
+ });
18
+ return Boolean(fastDay);
19
+ }
@@ -10,7 +10,6 @@ export declare class Location extends GeoLocation {
10
10
  zip?: string;
11
11
  population?: number;
12
12
  asciiname?: string;
13
- jersualem?: boolean;
14
13
  /**
15
14
  * Initialize a Location instance
16
15
  * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
@@ -141,7 +141,6 @@ export class Location extends GeoLocation {
141
141
  zip;
142
142
  population;
143
143
  asciiname;
144
- jersualem;
145
144
  /**
146
145
  * Initialize a Location instance
147
146
  * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "6.4.0";
2
+ export declare const version = "6.5.0";
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export const version = '6.4.0';
2
+ export const version = '6.5.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/core",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "contributors": [
6
6
  "Eyal Schachter (https://github.com/Scimonster)",
@@ -72,8 +72,8 @@
72
72
  "@rollup/plugin-node-resolve": "^16.0.3",
73
73
  "@rollup/plugin-terser": "^1.0.0",
74
74
  "@rollup/plugin-typescript": "^12.3.0",
75
- "@types/node": "^25.6.2",
76
- "@vitest/coverage-v8": "^4.1.5",
75
+ "@types/node": "^25.7.0",
76
+ "@vitest/coverage-v8": "^4.1.6",
77
77
  "gettext-parser": "^9.0.2",
78
78
  "gts": "^7.0.0",
79
79
  "pretty-bytes": "^7.1.0",
@@ -82,7 +82,7 @@
82
82
  "rollup-plugin-visualizer": "^7.0.1",
83
83
  "typedoc": "^0.28.19",
84
84
  "typescript": "^6.0.3",
85
- "vitest": "^4.1.5"
85
+ "vitest": "^4.1.6"
86
86
  },
87
87
  "dependencies": {
88
88
  "@hebcal/hdate": "^0.22.2",