@hebcal/core 6.4.1 → 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.
- package/README.md +33 -0
- package/dist/bundle.js +126 -64
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.min.js +5 -5
- package/dist/bundle.min.js.map +1 -1
- package/dist/esm/DailyLearning.js +1 -1
- package/dist/esm/HebrewDateEvent.js +1 -1
- package/dist/esm/HolidayEvent.js +1 -1
- package/dist/esm/MevarchimChodeshEvent.js +1 -1
- package/dist/esm/ParshaEvent.d.ts +6 -1
- package/dist/esm/ParshaEvent.js +7 -2
- package/dist/esm/ParshaEvent.js.map +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 +1 -1
- package/dist/esm/candles.js +1 -1
- package/dist/esm/event.js +2 -2
- package/dist/esm/event.js.map +1 -1
- package/dist/esm/getStartAndEnd.js +1 -1
- package/dist/esm/hallel.js +1 -1
- package/dist/esm/he-x-NoNikud.po.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.d.ts +2 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/isAssurBemlacha.js +1 -1
- package/dist/esm/isAveilut.d.ts +11 -0
- package/dist/esm/isAveilut.js +42 -0
- package/dist/esm/isAveilut.js.map +1 -0
- package/dist/esm/isFastDay.d.ts +9 -0
- package/dist/esm/isFastDay.js +24 -0
- package/dist/esm/isFastDay.js.map +1 -0
- 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 +1 -1
- package/dist/esm/moladBase.js +1 -1
- package/dist/esm/moladDate.js +1 -1
- package/dist/esm/omer.js +1 -1
- package/dist/esm/parshaName.js +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 +1 -1
- package/dist/esm/sedra.js +1 -1
- package/dist/esm/sefira.json.js +1 -1
- package/dist/esm/staticHolidays.js +1 -1
- package/dist/esm/tachanun.js +1 -1
- package/dist/esm/temporal-shim.js +1 -1
- package/dist/esm/zmanim.js +1 -1
- package/dist/src/ParshaEvent.d.ts +6 -1
- package/dist/src/ParshaEvent.js +6 -1
- package/dist/src/event.js +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/isAveilut.d.ts +11 -0
- package/dist/src/isAveilut.js +37 -0
- package/dist/src/isFastDay.d.ts +9 -0
- package/dist/src/isFastDay.js +19 -0
- package/dist/src/pkgVersion.d.ts +1 -1
- package/dist/src/pkgVersion.js +1 -1
- package/package.json +4 -4
package/dist/src/ParshaEvent.js
CHANGED
|
@@ -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', '
|
|
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'],
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
+
}
|
package/dist/src/pkgVersion.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export declare const version = "6.
|
|
2
|
+
export declare const version = "6.5.0";
|
package/dist/src/pkgVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
2
|
-
export const version = '6.
|
|
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.
|
|
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.
|
|
76
|
-
"@vitest/coverage-v8": "^4.1.
|
|
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.
|
|
85
|
+
"vitest": "^4.1.6"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@hebcal/hdate": "^0.22.2",
|