@hebcal/core 5.4.0 → 5.4.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.
- package/README.md +2 -2
- package/dist/CalOptions.d.ts +157 -0
- package/dist/DailyLearning.d.ts +2 -1
- package/dist/HebrewDateEvent.d.ts +27 -2
- package/dist/HolidayEvent.d.ts +45 -0
- package/dist/MevarchimChodeshEvent.d.ts +27 -0
- package/dist/ParshaEvent.d.ts +18 -8
- package/dist/TimedEvent.d.ts +53 -0
- package/dist/YomKippurKatanEvent.d.ts +27 -0
- package/dist/bundle.js +2154 -2801
- package/dist/bundle.min.js +2 -2
- package/dist/candles.d.ts +14 -61
- package/dist/event.d.ts +73 -42
- package/dist/getStartAndEnd.d.ts +6 -0
- package/dist/hallel.d.ts +3 -1
- package/dist/hebcal.d.ts +3 -165
- package/dist/holidays.d.ts +2 -35
- package/dist/index.cjs +2113 -2753
- package/dist/index.d.ts +13 -11
- package/dist/index.mjs +2114 -2754
- package/dist/location.d.ts +4 -4
- package/dist/modern.d.ts +3 -3
- package/dist/molad.d.ts +14 -13
- package/dist/omer.d.ts +23 -5
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/reformatTimeStr.d.ts +2 -1
- package/dist/sedra.d.ts +2 -2
- package/dist/staticHolidays.d.ts +165 -201
- package/dist/tachanun.d.ts +9 -7
- package/dist/zmanim.d.ts +40 -39
- package/package.json +7 -16
- package/dist/ashkenazi.po.d.ts +0 -68
- package/dist/dateFormat.d.ts +0 -33
- package/dist/hdate.d.ts +0 -395
- package/dist/he.po.d.ts +0 -306
- package/dist/locale-ashkenazi.d.ts +0 -1
- package/dist/locale-he.d.ts +0 -1
- package/dist/locale.d.ts +0 -80
- package/dist/staticHols.d.ts +0 -175
- package/dist/throwTypeError.d.ts +0 -5
package/dist/zmanim.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import 'temporal-polyfill/global';
|
|
2
|
+
import { GeoLocation } from '@hebcal/noaa';
|
|
3
|
+
import { HDate } from '@hebcal/hdate';
|
|
1
4
|
/**
|
|
2
5
|
* Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
|
|
3
6
|
* Calculations are available for tzeit / tzais (nightfall),
|
|
@@ -24,34 +27,11 @@
|
|
|
24
27
|
* const candleLighting = zmanim.sunsetOffset(-18, true);
|
|
25
28
|
* const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
|
|
26
29
|
*/
|
|
27
|
-
export class Zmanim {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
* @return {string}
|
|
33
|
-
*/
|
|
34
|
-
static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string;
|
|
35
|
-
/**
|
|
36
|
-
* Discards seconds, rounding to nearest minute.
|
|
37
|
-
* @param {Date} dt
|
|
38
|
-
* @return {Date}
|
|
39
|
-
*/
|
|
40
|
-
static roundTime(dt: Date): Date;
|
|
41
|
-
/**
|
|
42
|
-
* Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
|
|
43
|
-
* @param {string} tzid
|
|
44
|
-
* @param {Date} date
|
|
45
|
-
* @return {string}
|
|
46
|
-
*/
|
|
47
|
-
static timeZoneOffset(tzid: string, date: Date): string;
|
|
48
|
-
/**
|
|
49
|
-
* Returns a string like "2022-04-01T13:06:00-11:00"
|
|
50
|
-
* @param {string} tzid
|
|
51
|
-
* @param {Date} date
|
|
52
|
-
* @return {string}
|
|
53
|
-
*/
|
|
54
|
-
static formatISOWithTimeZone(tzid: string, date: Date): string;
|
|
30
|
+
export declare class Zmanim {
|
|
31
|
+
private readonly date;
|
|
32
|
+
private readonly gloc;
|
|
33
|
+
private readonly noaa;
|
|
34
|
+
private useElevation;
|
|
55
35
|
/**
|
|
56
36
|
* Initialize a Zmanim instance.
|
|
57
37
|
* @param {GeoLocation} gloc GeoLocation including latitude, longitude, and timezone
|
|
@@ -64,10 +44,6 @@ export class Zmanim {
|
|
|
64
44
|
* These zmanim intentionally do not support elevation adjustment.
|
|
65
45
|
*/
|
|
66
46
|
constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean);
|
|
67
|
-
date: any;
|
|
68
|
-
gloc: GeoLocation;
|
|
69
|
-
noaa: NOAACalculator;
|
|
70
|
-
useElevation: boolean;
|
|
71
47
|
/**
|
|
72
48
|
* Returns `true` if elevation adjustment is enabled
|
|
73
49
|
* for zmanim support elevation adjustment
|
|
@@ -136,7 +112,7 @@ export class Zmanim {
|
|
|
136
112
|
* @private
|
|
137
113
|
* @return {number}
|
|
138
114
|
*/
|
|
139
|
-
|
|
115
|
+
nightHour(): number;
|
|
140
116
|
/**
|
|
141
117
|
* Midday – Chatzot; Sunrise plus 6 halachic hours
|
|
142
118
|
* @return {Date}
|
|
@@ -175,7 +151,7 @@ export class Zmanim {
|
|
|
175
151
|
* @param {number} hours
|
|
176
152
|
* @return {Date}
|
|
177
153
|
*/
|
|
178
|
-
|
|
154
|
+
getShaahZmanisBasedZman(hours: number): Date;
|
|
179
155
|
/**
|
|
180
156
|
* Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
|
|
181
157
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
@@ -193,14 +169,14 @@ export class Zmanim {
|
|
|
193
169
|
* @private
|
|
194
170
|
* @return {any[]}
|
|
195
171
|
*/
|
|
196
|
-
|
|
172
|
+
getTemporalHour72(): any[];
|
|
197
173
|
/**
|
|
198
174
|
* Returns an array with alot (Date) and ms in hour (number)
|
|
199
175
|
* @private
|
|
200
176
|
* @param {number} angle
|
|
201
177
|
* @return {any[]}
|
|
202
178
|
*/
|
|
203
|
-
|
|
179
|
+
getTemporalHourByDeg(angle: number): any[];
|
|
204
180
|
/**
|
|
205
181
|
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
206
182
|
* Based on the opinion of the MGA that the day is calculated from
|
|
@@ -275,7 +251,7 @@ export class Zmanim {
|
|
|
275
251
|
* the result is not impacted by elevation.
|
|
276
252
|
* @return {Date}
|
|
277
253
|
*/
|
|
278
|
-
tzeit(angle?: number
|
|
254
|
+
tzeit(angle?: number): Date;
|
|
279
255
|
/**
|
|
280
256
|
* Alias for sunrise
|
|
281
257
|
* @return {Date}
|
|
@@ -296,6 +272,33 @@ export class Zmanim {
|
|
|
296
272
|
* @return {Date}
|
|
297
273
|
*/
|
|
298
274
|
beinHaShmashos(): Date;
|
|
275
|
+
/**
|
|
276
|
+
* Uses timeFormat to return a date like '20:34'
|
|
277
|
+
* @param {Date} dt
|
|
278
|
+
* @param {Intl.DateTimeFormat} timeFormat
|
|
279
|
+
* @return {string}
|
|
280
|
+
*/
|
|
281
|
+
static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string;
|
|
282
|
+
/**
|
|
283
|
+
* Discards seconds, rounding to nearest minute.
|
|
284
|
+
* @param {Date} dt
|
|
285
|
+
* @return {Date}
|
|
286
|
+
*/
|
|
287
|
+
static roundTime(dt: Date): Date;
|
|
288
|
+
/**
|
|
289
|
+
* Get offset string (like "+05:00" or "-08:00") from tzid (like "Europe/Moscow")
|
|
290
|
+
* @param {string} tzid
|
|
291
|
+
* @param {Date} date
|
|
292
|
+
* @return {string}
|
|
293
|
+
*/
|
|
294
|
+
static timeZoneOffset(tzid: string, date: Date): string;
|
|
295
|
+
/**
|
|
296
|
+
* Returns a string like "2022-04-01T13:06:00-11:00"
|
|
297
|
+
* @param {string} tzid
|
|
298
|
+
* @param {Date} date
|
|
299
|
+
* @return {string}
|
|
300
|
+
*/
|
|
301
|
+
static formatISOWithTimeZone(tzid: string, date: Date): string;
|
|
299
302
|
/**
|
|
300
303
|
* Returns sunrise + `offset` minutes (either positive or negative).
|
|
301
304
|
* If elevation is enabled, this function will include elevation in the calculation
|
|
@@ -317,5 +320,3 @@ export class Zmanim {
|
|
|
317
320
|
*/
|
|
318
321
|
sunsetOffset(offset: number, roundMinute?: boolean, forceSeaLevel?: boolean): Date;
|
|
319
322
|
}
|
|
320
|
-
import { NOAACalculator } from '@hebcal/noaa';
|
|
321
|
-
import { HDate } from '@hebcal/hdate';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hebcal/core",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"author": "Michael J. Radwin (https://github.com/mjradwin)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Eyal Schachter (https://github.com/Scimonster)",
|
|
@@ -52,25 +52,17 @@
|
|
|
52
52
|
"readme": "cp dist/index.mjs tmp.js && npx -p jsdoc-to-markdown jsdoc2md tmp.js && rm -f tmp.js",
|
|
53
53
|
"pretest": "npm run build",
|
|
54
54
|
"lint": "eslint src",
|
|
55
|
-
"coverage": "
|
|
56
|
-
"test": "
|
|
55
|
+
"coverage": "jest --coverage",
|
|
56
|
+
"test": "jest"
|
|
57
57
|
},
|
|
58
58
|
"license": "GPL-2.0",
|
|
59
|
-
"ava": {
|
|
60
|
-
"files": [
|
|
61
|
-
"src/**/*.spec.js"
|
|
62
|
-
],
|
|
63
|
-
"require": [
|
|
64
|
-
"@babel/register"
|
|
65
|
-
],
|
|
66
|
-
"verbose": true
|
|
67
|
-
},
|
|
68
59
|
"peerDependencies": {
|
|
69
60
|
"temporal-polyfill": "^0.2.4"
|
|
70
61
|
},
|
|
71
62
|
"devDependencies": {
|
|
72
63
|
"@babel/core": "^7.24.6",
|
|
73
64
|
"@babel/preset-env": "^7.24.6",
|
|
65
|
+
"@babel/preset-typescript": "^7.24.6",
|
|
74
66
|
"@babel/register": "^7.24.6",
|
|
75
67
|
"@rollup/plugin-babel": "^6.0.4",
|
|
76
68
|
"@rollup/plugin-commonjs": "^25.0.8",
|
|
@@ -78,20 +70,19 @@
|
|
|
78
70
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
79
71
|
"@rollup/plugin-terser": "^0.4.4",
|
|
80
72
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
81
|
-
"
|
|
73
|
+
"@types/jest": "^29.5.12",
|
|
82
74
|
"core-js": "^3.37.1",
|
|
83
75
|
"eslint": "^8.57.0",
|
|
84
76
|
"eslint-config-google": "^0.14.0",
|
|
77
|
+
"jest": "^29.7.0",
|
|
85
78
|
"jsdoc": "^4.0.3",
|
|
86
79
|
"jsdoc-to-markdown": "^8.0.1",
|
|
87
|
-
"nyc": "^15.1.0",
|
|
88
80
|
"quick-lru": "^7.0.0",
|
|
89
81
|
"rollup": "^4.18.0",
|
|
90
|
-
"ttag-cli": "^1.10.12",
|
|
91
82
|
"typescript": "^5.4.5"
|
|
92
83
|
},
|
|
93
84
|
"dependencies": {
|
|
94
|
-
"@hebcal/hdate": "^0.9.
|
|
85
|
+
"@hebcal/hdate": "^0.9.13",
|
|
95
86
|
"@hebcal/noaa": "^0.8.14",
|
|
96
87
|
"tslib": "^2.6.2"
|
|
97
88
|
}
|
package/dist/ashkenazi.po.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
let headers: {
|
|
3
|
-
"plural-forms": string;
|
|
4
|
-
};
|
|
5
|
-
let contexts: {
|
|
6
|
-
"": {
|
|
7
|
-
Shabbat: string[];
|
|
8
|
-
"Achrei Mot": string[];
|
|
9
|
-
Bechukotai: string[];
|
|
10
|
-
"Beha'alotcha": string[];
|
|
11
|
-
Bereshit: string[];
|
|
12
|
-
Chukat: string[];
|
|
13
|
-
"Erev Shavuot": string[];
|
|
14
|
-
"Erev Sukkot": string[];
|
|
15
|
-
"Ki Tavo": string[];
|
|
16
|
-
"Ki Teitzei": string[];
|
|
17
|
-
"Ki Tisa": string[];
|
|
18
|
-
Matot: string[];
|
|
19
|
-
"Purim Katan": string[];
|
|
20
|
-
"Shabbat Chazon": string[];
|
|
21
|
-
"Shabbat HaChodesh": string[];
|
|
22
|
-
"Shabbat HaGadol": string[];
|
|
23
|
-
"Shabbat Nachamu": string[];
|
|
24
|
-
"Shabbat Parah": string[];
|
|
25
|
-
"Shabbat Shekalim": string[];
|
|
26
|
-
"Shabbat Shuva": string[];
|
|
27
|
-
"Shabbat Zachor": string[];
|
|
28
|
-
Shavuot: string[];
|
|
29
|
-
"Shavuot I": string[];
|
|
30
|
-
"Shavuot II": string[];
|
|
31
|
-
Shemot: string[];
|
|
32
|
-
"Shmini Atzeret": string[];
|
|
33
|
-
"Simchat Torah": string[];
|
|
34
|
-
Sukkot: string[];
|
|
35
|
-
"Sukkot I": string[];
|
|
36
|
-
"Sukkot II": string[];
|
|
37
|
-
"Sukkot II (CH''M)": string[];
|
|
38
|
-
"Sukkot III (CH''M)": string[];
|
|
39
|
-
"Sukkot IV (CH''M)": string[];
|
|
40
|
-
"Sukkot V (CH''M)": string[];
|
|
41
|
-
"Sukkot VI (CH''M)": string[];
|
|
42
|
-
"Sukkot VII (Hoshana Raba)": string[];
|
|
43
|
-
"Ta'anit Bechorot": string[];
|
|
44
|
-
"Ta'anit Esther": string[];
|
|
45
|
-
Toldot: string[];
|
|
46
|
-
Vaetchanan: string[];
|
|
47
|
-
Yitro: string[];
|
|
48
|
-
"Vezot Haberakhah": string[];
|
|
49
|
-
Parashat: string[];
|
|
50
|
-
"Leil Selichot": string[];
|
|
51
|
-
"Shabbat Mevarchim Chodesh": string[];
|
|
52
|
-
"Shabbat Shirah": string[];
|
|
53
|
-
Tevet: string[];
|
|
54
|
-
"Asara B'Tevet": string[];
|
|
55
|
-
"Alot HaShachar": string[];
|
|
56
|
-
"Kriat Shema, sof zeman": string[];
|
|
57
|
-
"Tefilah, sof zeman": string[];
|
|
58
|
-
"Kriat Shema, sof zeman (MGA)": string[];
|
|
59
|
-
"Tefilah, sof zeman (MGA)": string[];
|
|
60
|
-
"Chatzot HaLailah": string[];
|
|
61
|
-
"Chatzot hayom": string[];
|
|
62
|
-
"Tzeit HaKochavim": string[];
|
|
63
|
-
"Birkat Hachamah": string[];
|
|
64
|
-
"Shushan Purim Katan": string[];
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export default _default;
|
package/dist/dateFormat.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @private
|
|
3
|
-
* @param {string} tzid
|
|
4
|
-
* @param {Date} date
|
|
5
|
-
* @return {string}
|
|
6
|
-
*/
|
|
7
|
-
export function getPseudoISO(tzid: string, date: Date): string;
|
|
8
|
-
/**
|
|
9
|
-
* @private
|
|
10
|
-
* @param {string} tzid
|
|
11
|
-
* @param {Date} date
|
|
12
|
-
* @return {number}
|
|
13
|
-
*/
|
|
14
|
-
export function getTimezoneOffset(tzid: string, date: Date): number;
|
|
15
|
-
/**
|
|
16
|
-
* @private
|
|
17
|
-
* @param {number} number
|
|
18
|
-
* @return {string}
|
|
19
|
-
*/
|
|
20
|
-
export function pad4(number: number): string;
|
|
21
|
-
/**
|
|
22
|
-
* @private
|
|
23
|
-
* @param {number} number
|
|
24
|
-
* @return {string}
|
|
25
|
-
*/
|
|
26
|
-
export function pad2(number: number): string;
|
|
27
|
-
/**
|
|
28
|
-
* Returns YYYY-MM-DD in the local timezone
|
|
29
|
-
* @private
|
|
30
|
-
* @param {Date} dt
|
|
31
|
-
* @return {string}
|
|
32
|
-
*/
|
|
33
|
-
export function isoDateString(dt: Date): string;
|
package/dist/hdate.d.ts
DELETED
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A simple Hebrew date object with numeric fields `yy`, `mm`, and `dd`
|
|
3
|
-
* @typedef {Object} SimpleHebrewDate
|
|
4
|
-
* @property {number} yy Hebrew year
|
|
5
|
-
* @property {number} mm Hebrew month of year (1=NISAN, 7=TISHREI)
|
|
6
|
-
* @property {number} dd Day of month (1-30)
|
|
7
|
-
* @private
|
|
8
|
-
*/
|
|
9
|
-
/** Represents a Hebrew date */
|
|
10
|
-
export class HDate {
|
|
11
|
-
/**
|
|
12
|
-
* Converts Hebrew date to R.D. (Rata Die) fixed days.
|
|
13
|
-
* R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
|
|
14
|
-
* Calendar.
|
|
15
|
-
* @param {number} year Hebrew year
|
|
16
|
-
* @param {number} month Hebrew month
|
|
17
|
-
* @param {number} day Hebrew date (1-30)
|
|
18
|
-
* @return {number}
|
|
19
|
-
*/
|
|
20
|
-
static hebrew2abs(year: number, month: number, day: number): number;
|
|
21
|
-
/**
|
|
22
|
-
* @private
|
|
23
|
-
* @param {string} locale
|
|
24
|
-
* @return {string}
|
|
25
|
-
*/
|
|
26
|
-
private static getDayOfTranslation;
|
|
27
|
-
/**
|
|
28
|
-
* @private
|
|
29
|
-
* @param {string} units
|
|
30
|
-
* @return {string}
|
|
31
|
-
*/
|
|
32
|
-
private static standardizeUnits;
|
|
33
|
-
/**
|
|
34
|
-
* Returns true if Hebrew year is a leap year
|
|
35
|
-
* @param {number} year Hebrew year
|
|
36
|
-
* @return {boolean}
|
|
37
|
-
*/
|
|
38
|
-
static isLeapYear(year: number): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Number of months in this Hebrew year (either 12 or 13 depending on leap year)
|
|
41
|
-
* @param {number} year Hebrew year
|
|
42
|
-
* @return {number}
|
|
43
|
-
*/
|
|
44
|
-
static monthsInYear(year: number): number;
|
|
45
|
-
/**
|
|
46
|
-
* Number of days in Hebrew month in a given year (29 or 30)
|
|
47
|
-
* @param {number} month Hebrew month (e.g. months.TISHREI)
|
|
48
|
-
* @param {number} year Hebrew year
|
|
49
|
-
* @return {number}
|
|
50
|
-
*/
|
|
51
|
-
static daysInMonth(month: number, year: number): number;
|
|
52
|
-
/**
|
|
53
|
-
* Returns a transliterated string name of Hebrew month in year,
|
|
54
|
-
* for example 'Elul' or 'Cheshvan'.
|
|
55
|
-
* @param {number} month Hebrew month (e.g. months.TISHREI)
|
|
56
|
-
* @param {number} year Hebrew year
|
|
57
|
-
* @return {string}
|
|
58
|
-
*/
|
|
59
|
-
static getMonthName(month: number, year: number): string;
|
|
60
|
-
/**
|
|
61
|
-
* Returns the Hebrew month number (NISAN=1, TISHREI=7)
|
|
62
|
-
* @param {number|string} month A number, or Hebrew month name string
|
|
63
|
-
* @return {number}
|
|
64
|
-
*/
|
|
65
|
-
static monthNum(month: number | string): number;
|
|
66
|
-
/**
|
|
67
|
-
* Number of days in the hebrew YEAR
|
|
68
|
-
* @param {number} year Hebrew year
|
|
69
|
-
* @return {number}
|
|
70
|
-
*/
|
|
71
|
-
static daysInYear(year: number): number;
|
|
72
|
-
/**
|
|
73
|
-
* true if Cheshvan is long in Hebrew year
|
|
74
|
-
* @param {number} year Hebrew year
|
|
75
|
-
* @return {boolean}
|
|
76
|
-
*/
|
|
77
|
-
static longCheshvan(year: number): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* true if Kislev is short in Hebrew year
|
|
80
|
-
* @param {number} year Hebrew year
|
|
81
|
-
* @return {boolean}
|
|
82
|
-
*/
|
|
83
|
-
static shortKislev(year: number): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Converts Hebrew month string name to numeric
|
|
86
|
-
* @param {string|number} monthName monthName
|
|
87
|
-
* @return {number}
|
|
88
|
-
*/
|
|
89
|
-
static monthFromName(monthName: string | number): number;
|
|
90
|
-
/**
|
|
91
|
-
* Note: Applying this function to d+6 gives us the DAYNAME on or after an
|
|
92
|
-
* absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to
|
|
93
|
-
* absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
|
|
94
|
-
* date d, and applying it to d+7 gives the DAYNAME following absolute date d.
|
|
95
|
-
* @param {number} dayOfWeek
|
|
96
|
-
* @param {number} absdate
|
|
97
|
-
* @return {number}
|
|
98
|
-
*/
|
|
99
|
-
static dayOnOrBefore(dayOfWeek: number, absdate: number): number;
|
|
100
|
-
/**
|
|
101
|
-
* Tests if the object is an instance of `HDate`
|
|
102
|
-
* @param {any} obj
|
|
103
|
-
* @return {boolean}
|
|
104
|
-
*/
|
|
105
|
-
static isHDate(obj: any): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Construct a new instance of `HDate` from a Gematriya-formatted string
|
|
108
|
-
* @example
|
|
109
|
-
* HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
|
|
110
|
-
* HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
|
|
111
|
-
* HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
|
|
112
|
-
* @param {string} str
|
|
113
|
-
* @param {number} currentThousands
|
|
114
|
-
* @return {HDate}
|
|
115
|
-
*/
|
|
116
|
-
static fromGematriyaString(str: string, currentThousands?: number): HDate;
|
|
117
|
-
/**
|
|
118
|
-
* Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
|
|
119
|
-
*
|
|
120
|
-
* 1. No parameters - represents the current Hebrew date at time of instantiation
|
|
121
|
-
* 2. One parameter
|
|
122
|
-
* * `Date` - represents the Hebrew date corresponding to the Gregorian date using
|
|
123
|
-
* local time. Hours, minutes, seconds and milliseconds are ignored.
|
|
124
|
-
* * `HDate` - clones a copy of the given Hebrew date
|
|
125
|
-
* * `number` - Converts absolute R.D. days to Hebrew date.
|
|
126
|
-
* R.D. 1 == the imaginary date January 1, 1 (Gregorian)
|
|
127
|
-
* 3. Three parameters: Hebrew day, Hebrew month, Hebrew year. Hebrew day should
|
|
128
|
-
* be a number between 1-30, Hebrew month can be a number or string, and
|
|
129
|
-
* Hebrew year is always a number.
|
|
130
|
-
* @example
|
|
131
|
-
* import {HDate, months} from '@hebcal/core';
|
|
132
|
-
*
|
|
133
|
-
* const hd1 = new HDate();
|
|
134
|
-
* const hd2 = new HDate(new Date(2008, 10, 13));
|
|
135
|
-
* const hd3 = new HDate(15, 'Cheshvan', 5769);
|
|
136
|
-
* const hd4 = new HDate(15, months.CHESHVAN, 5769);
|
|
137
|
-
* const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769
|
|
138
|
-
* const monthName = 'אייר';
|
|
139
|
-
* const hd6 = new HDate(5, monthName, 5773);
|
|
140
|
-
* @param {number|Date|HDate} [day] - Day of month (1-30) if a `number`.
|
|
141
|
-
* If a `Date` is specified, represents the Hebrew date corresponding to the
|
|
142
|
-
* Gregorian date using local time.
|
|
143
|
-
* If an `HDate` is specified, clones a copy of the given Hebrew date.
|
|
144
|
-
* @param {number|string} [month] - Hebrew month of year (1=NISAN, 7=TISHREI)
|
|
145
|
-
* @param {number} [year] - Hebrew year
|
|
146
|
-
*/
|
|
147
|
-
constructor(day?: number | HDate | Date | undefined, month?: string | number | undefined, year?: number | undefined, ...args: any[]);
|
|
148
|
-
/**
|
|
149
|
-
* @private
|
|
150
|
-
* @type {number}
|
|
151
|
-
*/
|
|
152
|
-
private dd;
|
|
153
|
-
private mm;
|
|
154
|
-
yy: number;
|
|
155
|
-
/**
|
|
156
|
-
* @private
|
|
157
|
-
* @type {number}
|
|
158
|
-
*/
|
|
159
|
-
private rd;
|
|
160
|
-
/**
|
|
161
|
-
* Gets the Hebrew year of this Hebrew date
|
|
162
|
-
* @return {number}
|
|
163
|
-
*/
|
|
164
|
-
getFullYear(): number;
|
|
165
|
-
/**
|
|
166
|
-
* Tests if this date occurs during a leap year
|
|
167
|
-
* @return {boolean}
|
|
168
|
-
*/
|
|
169
|
-
isLeapYear(): boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Gets the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
|
|
172
|
-
* @return {number}
|
|
173
|
-
*/
|
|
174
|
-
getMonth(): number;
|
|
175
|
-
/**
|
|
176
|
-
* The Tishrei-based month of the date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
|
|
177
|
-
* @return {number}
|
|
178
|
-
*/
|
|
179
|
-
getTishreiMonth(): number;
|
|
180
|
-
/**
|
|
181
|
-
* Number of days in the month of this Hebrew date
|
|
182
|
-
* @return {number}
|
|
183
|
-
*/
|
|
184
|
-
daysInMonth(): number;
|
|
185
|
-
/**
|
|
186
|
-
* Gets the day within the month (1-30)
|
|
187
|
-
* @return {number}
|
|
188
|
-
*/
|
|
189
|
-
getDate(): number;
|
|
190
|
-
/**
|
|
191
|
-
* Gets the day of the week. 0=Sunday, 6=Saturday
|
|
192
|
-
* @return {number}
|
|
193
|
-
*/
|
|
194
|
-
getDay(): number;
|
|
195
|
-
/**
|
|
196
|
-
* Sets the day of the month of the date. Returns the object it was called upon
|
|
197
|
-
* @private
|
|
198
|
-
* @param {number|string} month A number, or Hebrew month name string
|
|
199
|
-
* @return {HDate}
|
|
200
|
-
*/
|
|
201
|
-
private setMonth;
|
|
202
|
-
/**
|
|
203
|
-
* @private
|
|
204
|
-
* @param {number} date
|
|
205
|
-
* @return {HDate}
|
|
206
|
-
*/
|
|
207
|
-
private setDate;
|
|
208
|
-
/**
|
|
209
|
-
* Converts to Gregorian date
|
|
210
|
-
* @return {Date}
|
|
211
|
-
*/
|
|
212
|
-
greg(): Date;
|
|
213
|
-
/**
|
|
214
|
-
* Returns R.D. (Rata Die) fixed days.
|
|
215
|
-
* R.D. 1 == Monday, January 1, 1 (Gregorian)
|
|
216
|
-
* Note also that R.D. = Julian Date − 1,721,424.5
|
|
217
|
-
* https://en.wikipedia.org/wiki/Rata_Die#Dershowitz_and_Reingold
|
|
218
|
-
* @return {number}
|
|
219
|
-
*/
|
|
220
|
-
abs(): number;
|
|
221
|
-
/**
|
|
222
|
-
* Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
|
|
223
|
-
* @return {string}
|
|
224
|
-
*/
|
|
225
|
-
getMonthName(): string;
|
|
226
|
-
/**
|
|
227
|
-
* Renders this Hebrew date as a translated or transliterated string,
|
|
228
|
-
* including ordinal e.g. `'15th of Cheshvan, 5769'`.
|
|
229
|
-
* @example
|
|
230
|
-
* import {HDate, months} from '@hebcal/core';
|
|
231
|
-
*
|
|
232
|
-
* const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
233
|
-
* console.log(hd.render('en')); // '15th of Cheshvan, 5769'
|
|
234
|
-
* console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
|
|
235
|
-
* @param {string} [locale] Optional locale name (defaults to active locale).
|
|
236
|
-
* @param {boolean} [showYear=true] Display year (defaults to true).
|
|
237
|
-
* @return {string}
|
|
238
|
-
*/
|
|
239
|
-
render(locale?: string | undefined, showYear?: boolean | undefined): string;
|
|
240
|
-
/**
|
|
241
|
-
* Renders this Hebrew date in Hebrew gematriya, regardless of locale.
|
|
242
|
-
* @example
|
|
243
|
-
* import {HDate, months} from '@hebcal/core';
|
|
244
|
-
* const hd = new HDate(15, months.CHESHVAN, 5769);
|
|
245
|
-
* console.log(hd.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
|
|
246
|
-
* @param {boolean} [suppressNikud]
|
|
247
|
-
* @return {string}
|
|
248
|
-
*/
|
|
249
|
-
renderGematriya(suppressNikud?: boolean | undefined): string;
|
|
250
|
-
/**
|
|
251
|
-
* Returns an `HDate` representing the a dayNumber before the current date.
|
|
252
|
-
* Sunday=0, Saturday=6
|
|
253
|
-
* @example
|
|
254
|
-
* new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
|
|
255
|
-
* @param {number} day day of week
|
|
256
|
-
* @return {HDate}
|
|
257
|
-
*/
|
|
258
|
-
before(day: number): HDate;
|
|
259
|
-
/**
|
|
260
|
-
* Returns an `HDate` representing the a dayNumber on or before the current date.
|
|
261
|
-
* Sunday=0, Saturday=6
|
|
262
|
-
* @example
|
|
263
|
-
* new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
|
|
264
|
-
* new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
|
|
265
|
-
* new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
|
|
266
|
-
* @param {number} dow day of week
|
|
267
|
-
* @return {HDate}
|
|
268
|
-
*/
|
|
269
|
-
onOrBefore(dow: number): HDate;
|
|
270
|
-
/**
|
|
271
|
-
* Returns an `HDate` representing the nearest dayNumber to the current date
|
|
272
|
-
* Sunday=0, Saturday=6
|
|
273
|
-
* @example
|
|
274
|
-
* new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
|
|
275
|
-
* new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
|
|
276
|
-
* @param {number} dow day of week
|
|
277
|
-
* @return {HDate}
|
|
278
|
-
*/
|
|
279
|
-
nearest(dow: number): HDate;
|
|
280
|
-
/**
|
|
281
|
-
* Returns an `HDate` representing the a dayNumber on or after the current date.
|
|
282
|
-
* Sunday=0, Saturday=6
|
|
283
|
-
* @example
|
|
284
|
-
* new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
|
|
285
|
-
* new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
|
|
286
|
-
* new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
|
|
287
|
-
* @param {number} dow day of week
|
|
288
|
-
* @return {HDate}
|
|
289
|
-
*/
|
|
290
|
-
onOrAfter(dow: number): HDate;
|
|
291
|
-
/**
|
|
292
|
-
* Returns an `HDate` representing the a dayNumber after the current date.
|
|
293
|
-
* Sunday=0, Saturday=6
|
|
294
|
-
* @example
|
|
295
|
-
* new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
|
|
296
|
-
* new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
|
|
297
|
-
* new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
|
|
298
|
-
* @param {number} day day of week
|
|
299
|
-
* @return {HDate}
|
|
300
|
-
*/
|
|
301
|
-
after(day: number): HDate;
|
|
302
|
-
/**
|
|
303
|
-
* Returns the next Hebrew date
|
|
304
|
-
* @return {HDate}
|
|
305
|
-
*/
|
|
306
|
-
next(): HDate;
|
|
307
|
-
/**
|
|
308
|
-
* Returns the previous Hebrew date
|
|
309
|
-
* @return {HDate}
|
|
310
|
-
*/
|
|
311
|
-
prev(): HDate;
|
|
312
|
-
/**
|
|
313
|
-
* Returns a cloned `HDate` object with a specified amount of time added
|
|
314
|
-
*
|
|
315
|
-
* Units are case insensitive, and support plural and short forms.
|
|
316
|
-
* Note, short forms are case sensitive.
|
|
317
|
-
*
|
|
318
|
-
* | Unit | Shorthand | Description
|
|
319
|
-
* | --- | --- | --- |
|
|
320
|
-
* | `day` | `d` | days |
|
|
321
|
-
* | `week` | `w` | weeks |
|
|
322
|
-
* | `month` | `M` | months |
|
|
323
|
-
* | `year` | `y` | years |
|
|
324
|
-
* @param {number} number
|
|
325
|
-
* @param {string} [units]
|
|
326
|
-
* @return {HDate}
|
|
327
|
-
*/
|
|
328
|
-
add(number: number, units?: string | undefined): HDate;
|
|
329
|
-
/**
|
|
330
|
-
* Returns a cloned `HDate` object with a specified amount of time subracted
|
|
331
|
-
*
|
|
332
|
-
* Units are case insensitive, and support plural and short forms.
|
|
333
|
-
* Note, short forms are case sensitive.
|
|
334
|
-
*
|
|
335
|
-
* | Unit | Shorthand | Description
|
|
336
|
-
* | --- | --- | --- |
|
|
337
|
-
* | `day` | `d` | days |
|
|
338
|
-
* | `week` | `w` | weeks |
|
|
339
|
-
* | `month` | `M` | months |
|
|
340
|
-
* | `year` | `y` | years |
|
|
341
|
-
* @example
|
|
342
|
-
* import {HDate, months} from '@hebcal/core';
|
|
343
|
-
*
|
|
344
|
-
* const hd1 = new HDate(15, months.CHESHVAN, 5769);
|
|
345
|
-
* const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
|
|
346
|
-
* const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
|
|
347
|
-
* @param {number} number
|
|
348
|
-
* @param {string} [units]
|
|
349
|
-
* @return {HDate}
|
|
350
|
-
*/
|
|
351
|
-
subtract(number: number, units?: string | undefined): HDate;
|
|
352
|
-
/**
|
|
353
|
-
* Returns the difference in days between the two given HDates.
|
|
354
|
-
*
|
|
355
|
-
* The result is positive if `this` date is comes chronologically
|
|
356
|
-
* after the `other` date, and negative
|
|
357
|
-
* if the order of the two dates is reversed.
|
|
358
|
-
*
|
|
359
|
-
* The result is zero if the two dates are identical.
|
|
360
|
-
* @example
|
|
361
|
-
* import {HDate, months} from '@hebcal/core';
|
|
362
|
-
*
|
|
363
|
-
* const hd1 = new HDate(25, months.KISLEV, 5770);
|
|
364
|
-
* const hd2 = new HDate(15, months.CHESHVAN, 5769);
|
|
365
|
-
* const days = hd1.deltaDays(hd2); // 394
|
|
366
|
-
* @param {HDate} other Hebrew date to compare
|
|
367
|
-
* @return {number}
|
|
368
|
-
*/
|
|
369
|
-
deltaDays(other: HDate): number;
|
|
370
|
-
/**
|
|
371
|
-
* Compares this date to another date, returning `true` if the dates match.
|
|
372
|
-
* @param {HDate} other Hebrew date to compare
|
|
373
|
-
* @return {boolean}
|
|
374
|
-
*/
|
|
375
|
-
isSameDate(other: HDate): boolean;
|
|
376
|
-
/** @return {string} */
|
|
377
|
-
toString(): string;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* A simple Hebrew date object with numeric fields `yy`, `mm`, and `dd`
|
|
381
|
-
*/
|
|
382
|
-
export type SimpleHebrewDate = {
|
|
383
|
-
/**
|
|
384
|
-
* Hebrew year
|
|
385
|
-
*/
|
|
386
|
-
yy: number;
|
|
387
|
-
/**
|
|
388
|
-
* Hebrew month of year (1=NISAN, 7=TISHREI)
|
|
389
|
-
*/
|
|
390
|
-
mm: number;
|
|
391
|
-
/**
|
|
392
|
-
* Day of month (1-30)
|
|
393
|
-
*/
|
|
394
|
-
dd: number;
|
|
395
|
-
};
|