@hebcal/core 5.8.13 → 5.9.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 (44) hide show
  1. package/dist/DailyLearning.d.ts +4 -1
  2. package/dist/bundle.js +20 -8
  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 +1 -1
  10. package/dist/esm/HolidayEvent.js +1 -1
  11. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  12. package/dist/esm/ParshaEvent.js +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 +1 -1
  19. package/dist/esm/getStartAndEnd.js +1 -1
  20. package/dist/esm/hallel.js +1 -1
  21. package/dist/esm/he.po.js +1 -1
  22. package/dist/esm/hebcal.js +1 -1
  23. package/dist/esm/holidays.js +1 -1
  24. package/dist/esm/index.js +1 -1
  25. package/dist/esm/locale.js +1 -1
  26. package/dist/esm/location.js +1 -1
  27. package/dist/esm/modern.js +1 -1
  28. package/dist/esm/molad.js +1 -1
  29. package/dist/esm/omer.js +1 -1
  30. package/dist/esm/parshaName.js +1 -1
  31. package/dist/esm/parshaYear.js +1 -1
  32. package/dist/esm/pkgVersion.d.ts +1 -1
  33. package/dist/esm/pkgVersion.js +2 -2
  34. package/dist/esm/pkgVersion.js.map +1 -1
  35. package/dist/esm/reformatTimeStr.js +1 -1
  36. package/dist/esm/sedra.js +1 -1
  37. package/dist/esm/staticHolidays.js +2 -1
  38. package/dist/esm/staticHolidays.js.map +1 -1
  39. package/dist/esm/tachanun.js +1 -1
  40. package/dist/esm/zmanim.js +1 -1
  41. package/dist/index.cjs +20 -8
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/pkgVersion.d.ts +1 -1
  44. package/package.json +7 -7
@@ -9,8 +9,10 @@ export declare class DailyLearning {
9
9
  /**
10
10
  * Register a new learning calendar.
11
11
  * @param name case insensitive
12
+ * @param calendar a function that returns an `Event` or `null`
13
+ * @param startDate the first date for which this calendar is valid
12
14
  */
13
- static addCalendar(name: string, calendar: Function): void;
15
+ static addCalendar(name: string, calendar: Function, startDate?: HDate): void;
14
16
  /**
15
17
  * Returns an event from daily calendar for a given date. Returns `null` if there
16
18
  * is no learning from this calendar on this date.
@@ -19,6 +21,7 @@ export declare class DailyLearning {
19
21
  * @param il true for Israel, false for Diaspora
20
22
  */
21
23
  static lookup(name: string, hd: HDate, il: boolean): Event | null;
24
+ static getStartDate(name: string): HDate | undefined;
22
25
  /**
23
26
  * Tests to see if learning calendar has been registered
24
27
  * @param name case insensitive
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! @hebcal/core v5.8.13, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v5.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
5
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
6
- const version = '5.8.13';
6
+ const version = '5.9.0';
7
7
 
8
8
  /*! @hebcal/hdate v0.13.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
@@ -11130,6 +11130,7 @@ const staticModernHolidays = [
11130
11130
  desc: SIGD,
11131
11131
  chul: true,
11132
11132
  suppressEmoji: true,
11133
+ friSatMovetoThu: true,
11133
11134
  },
11134
11135
  { firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH, chul: true },
11135
11136
  { firstYear: 5777, mm: Cheshvan, dd: 7, desc: YOM_HAALIYAH_SCHOOL_OBSERVANCE },
@@ -12944,7 +12945,6 @@ class MevarchimChodeshEvent extends Event {
12944
12945
  }
12945
12946
  }
12946
12947
 
12947
- /** @private */
12948
12948
  const cals = new Map();
12949
12949
  /**
12950
12950
  * Plug-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.
@@ -12955,12 +12955,17 @@ class DailyLearning {
12955
12955
  /**
12956
12956
  * Register a new learning calendar.
12957
12957
  * @param name case insensitive
12958
+ * @param calendar a function that returns an `Event` or `null`
12959
+ * @param startDate the first date for which this calendar is valid
12958
12960
  */
12959
- static addCalendar(name, calendar) {
12961
+ static addCalendar(name, calendar, startDate) {
12960
12962
  if (typeof calendar !== 'function') {
12961
12963
  throw new TypeError(`Invalid calendar function: ${calendar}`);
12962
12964
  }
12963
- cals.set(name.toLowerCase(), calendar);
12965
+ cals.set(name.toLowerCase(), {
12966
+ fn: calendar,
12967
+ startDate: startDate,
12968
+ });
12964
12969
  }
12965
12970
  /**
12966
12971
  * Returns an event from daily calendar for a given date. Returns `null` if there
@@ -12970,12 +12975,19 @@ class DailyLearning {
12970
12975
  * @param il true for Israel, false for Diaspora
12971
12976
  */
12972
12977
  static lookup(name, hd, il) {
12973
- const fn = cals.get(name.toLowerCase());
12974
- if (typeof fn === 'function') {
12975
- return fn(hd, il);
12978
+ const cal = cals.get(name.toLowerCase());
12979
+ if (typeof cal === 'object') {
12980
+ return cal.fn(hd, il);
12976
12981
  }
12977
12982
  return null;
12978
12983
  }
12984
+ static getStartDate(name) {
12985
+ const cal = cals.get(name.toLowerCase());
12986
+ if (typeof cal === 'object') {
12987
+ return cal.startDate;
12988
+ }
12989
+ return undefined;
12990
+ }
12979
12991
  /**
12980
12992
  * Tests to see if learning calendar has been registered
12981
12993
  * @param name case insensitive