jcal-zmanim 1.0.4

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 (50) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +2 -0
  3. package/build/AppUtils.d.ts +109 -0
  4. package/build/AppUtils.js +394 -0
  5. package/build/GeneralUtils.d.ts +43 -0
  6. package/build/GeneralUtils.js +93 -0
  7. package/build/JCal/Dafyomi.d.ts +27 -0
  8. package/build/JCal/Dafyomi.js +131 -0
  9. package/build/JCal/Location.d.ts +33 -0
  10. package/build/JCal/Location.js +80 -0
  11. package/build/JCal/Molad.d.ts +39 -0
  12. package/build/JCal/Molad.js +95 -0
  13. package/build/JCal/PirkeiAvos.d.ts +13 -0
  14. package/build/JCal/PirkeiAvos.js +172 -0
  15. package/build/JCal/Sedra.d.ts +63 -0
  16. package/build/JCal/Sedra.js +186 -0
  17. package/build/JCal/Utils.d.ts +225 -0
  18. package/build/JCal/Utils.js +666 -0
  19. package/build/JCal/Zmanim.d.ts +95 -0
  20. package/build/JCal/Zmanim.js +224 -0
  21. package/build/JCal/jDate.d.ts +203 -0
  22. package/build/JCal/jDate.js +647 -0
  23. package/build/Locations.d.ts +7 -0
  24. package/build/Locations.js +1308 -0
  25. package/build/Notifications.d.ts +14 -0
  26. package/build/Notifications.js +1040 -0
  27. package/build/Settings.d.ts +25 -0
  28. package/build/Settings.js +75 -0
  29. package/build/ZmanTypes.d.ts +34 -0
  30. package/build/ZmanTypes.js +184 -0
  31. package/build/index.d.ts +1 -0
  32. package/build/index.js +59 -0
  33. package/package.json +33 -0
  34. package/src/AppUtils.ts +500 -0
  35. package/src/GeneralUtils.ts +84 -0
  36. package/src/JCal/Dafyomi.ts +139 -0
  37. package/src/JCal/Location.ts +100 -0
  38. package/src/JCal/Molad.ts +105 -0
  39. package/src/JCal/PirkeiAvos.ts +180 -0
  40. package/src/JCal/Sedra.ts +215 -0
  41. package/src/JCal/Utils.ts +732 -0
  42. package/src/JCal/Zmanim.ts +270 -0
  43. package/src/JCal/jDate.ts +714 -0
  44. package/src/Locations.ts +1303 -0
  45. package/src/Notifications.ts +1243 -0
  46. package/src/Settings.ts +103 -0
  47. package/src/ZmanTypes.ts +184 -0
  48. package/src/index.ts +31 -0
  49. package/src/jcal-zmanim.d.ts +4 -0
  50. package/tsconfig.json +109 -0
@@ -0,0 +1,95 @@
1
+ import jDate from './jDate.js';
2
+ import Location from './Location.js';
3
+ import { SunTimes, Time } from '../jcal-zmanim.js';
4
+ /**
5
+ * Computes the daily Zmanim for any single date at any location.
6
+ * The astronomical and mathematical calculations were directly adapted from the excellent
7
+ * Jewish calendar calculation in C# Copyright © by Ulrich and Ziporah Greve (2005)
8
+ */
9
+ export default class Zmanim {
10
+ /**
11
+ * Gets sunrise and sunset time for given date and Location.
12
+ * Accepts a javascript Date object, a string for creating a javascript date object or a jDate object.
13
+ * Location object is required.
14
+ * @returns {SunTimes}
15
+ * @param {Date | jDate} date A Javascript Date or Jewish Date for which to calculate the sun times.
16
+ * @param {Location} location Where on the globe to calculate the sun times for.
17
+ * @param {Boolean} considerElevation
18
+ */
19
+ static getSunTimes(date: Date | jDate, location: Location, considerElevation?: boolean): SunTimes;
20
+ /**
21
+ * @param {jDate | Date} date
22
+ * @param {Location} location
23
+ */
24
+ static getChatzos(date: jDate | Date, location: Location): Time;
25
+ /**
26
+ * @param {SunTimes} sunTimes
27
+ */
28
+ static getChatzosFromSuntimes(sunTimes: SunTimes): Time;
29
+ /**
30
+ * @param {jDate | Date} date
31
+ * @param {Location} location
32
+ * @param {any} offset
33
+ */
34
+ static getShaaZmanis(date: jDate | Date, location: Location, offset: number): number;
35
+ /**
36
+ * @param {{ sunrise: any; sunset: any; }} sunTimes
37
+ * @param {number} [offset]
38
+ */
39
+ static getShaaZmanisFromSunTimes(sunTimes: SunTimes, offset?: number): number;
40
+ /**
41
+ * @param {{ sunrise: any; sunset: any; }} sunTimes
42
+ * @param {boolean} israel
43
+ */
44
+ static getShaaZmanisMga(sunTimes: SunTimes, israel: boolean): number;
45
+ /**
46
+ * @param {jDate | Date} date
47
+ * @param {Location} location
48
+ */
49
+ static getCandleLighting(date: Date | jDate, location: Location): Time | undefined;
50
+ /**
51
+ * @param {SunTimes} sunTimes
52
+ * @param {any} location
53
+ */
54
+ static getCandleLightingFromSunTimes(sunTimes: SunTimes, location: Location): Time | undefined;
55
+ /**
56
+ * @param {Time} sunset
57
+ * @param {Location} location
58
+ */
59
+ static getCandleLightingFromSunset(sunset: Time, location: Location): Time | undefined;
60
+ /**
61
+ * @param {Date} date
62
+ */
63
+ static dayOfYear(date: Date): number;
64
+ /**
65
+ * @param {number} deg
66
+ * @param {number} min
67
+ */
68
+ static degToDec(deg: number, min: number): number;
69
+ /**
70
+ * @param {number} x
71
+ */
72
+ static M(x: number): number;
73
+ /**
74
+ * @param {number} x
75
+ */
76
+ static L(x: number): number;
77
+ /**
78
+ * @param {number} x
79
+ */
80
+ static adj(x: number): number;
81
+ /**
82
+ * @param {number} rad
83
+ */
84
+ static radToDeg(rad: number): number;
85
+ /**
86
+ * @param {number} time
87
+ * @param {Date} date
88
+ * @param {Location} location
89
+ */
90
+ static timeAdj(time: number, date: Date, location: Location): {
91
+ hour: number;
92
+ minute: number;
93
+ second: number;
94
+ };
95
+ }
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Utils_js_1 = __importDefault(require("./Utils.js"));
7
+ const jDate_js_1 = __importDefault(require("./jDate.js"));
8
+ const GeneralUtils_js_1 = require("../GeneralUtils.js");
9
+ /**
10
+ * Computes the daily Zmanim for any single date at any location.
11
+ * The astronomical and mathematical calculations were directly adapted from the excellent
12
+ * Jewish calendar calculation in C# Copyright © by Ulrich and Ziporah Greve (2005)
13
+ */
14
+ class Zmanim {
15
+ /**
16
+ * Gets sunrise and sunset time for given date and Location.
17
+ * Accepts a javascript Date object, a string for creating a javascript date object or a jDate object.
18
+ * Location object is required.
19
+ * @returns {SunTimes}
20
+ * @param {Date | jDate} date A Javascript Date or Jewish Date for which to calculate the sun times.
21
+ * @param {Location} location Where on the globe to calculate the sun times for.
22
+ * @param {Boolean} considerElevation
23
+ */
24
+ static getSunTimes(date, location, considerElevation = true) {
25
+ if (date instanceof jDate_js_1.default) {
26
+ date = date.getDate();
27
+ }
28
+ else if (date instanceof String) {
29
+ date = new Date(date);
30
+ }
31
+ if (!(0, GeneralUtils_js_1.isValidDate)(date)) {
32
+ throw 'Zmanim.getSunTimes: supplied date parameter cannot be converted to a Date';
33
+ }
34
+ let sunrise, sunset, zenithDeg = 90, zenithMin = 50, lonHour = 0, longitude = 0, latitude = 0, cosLat = 0, sinLat = 0, cosZen = 0, sinDec = 0, cosDec = 0, xmRise = 0, xmSet = 0, xlRise = 0, xlSet = 0, aRise = 0, aSet = 0, ahrRise = 0, ahrSet = 0, hRise = 0, hSet = 0, tRise = 0, tSet = 0, utRise = 0, utSet = 0;
35
+ const day = Zmanim.dayOfYear(date), earthRadius = 6356900, zenithAtElevation = Zmanim.degToDec(zenithDeg, zenithMin) +
36
+ Zmanim.radToDeg(Math.acos(earthRadius / (earthRadius +
37
+ (considerElevation ? location.Elevation : 0))));
38
+ zenithDeg = Math.floor(zenithAtElevation);
39
+ zenithMin = (zenithAtElevation - zenithDeg) * 60;
40
+ cosZen = Math.cos(0.01745 * Zmanim.degToDec(zenithDeg, zenithMin));
41
+ longitude = location.Longitude;
42
+ lonHour = longitude / 15;
43
+ latitude = location.Latitude;
44
+ cosLat = Math.cos(0.01745 * latitude);
45
+ sinLat = Math.sin(0.01745 * latitude);
46
+ tRise = day + (6 + lonHour) / 24;
47
+ tSet = day + (18 + lonHour) / 24;
48
+ xmRise = Zmanim.M(tRise);
49
+ xlRise = Zmanim.L(xmRise);
50
+ xmSet = Zmanim.M(tSet);
51
+ xlSet = Zmanim.L(xmSet);
52
+ aRise = 57.29578 * Math.atan(0.91746 * Math.tan(0.01745 * xlRise));
53
+ aSet = 57.29578 * Math.atan(0.91746 * Math.tan(0.01745 * xlSet));
54
+ if (Math.abs(aRise + 360 - xlRise) > 90) {
55
+ aRise += 180;
56
+ }
57
+ if (aRise > 360) {
58
+ aRise -= 360;
59
+ }
60
+ if (Math.abs(aSet + 360 - xlSet) > 90) {
61
+ aSet += 180;
62
+ }
63
+ if (aSet > 360) {
64
+ aSet -= 360;
65
+ }
66
+ ahrRise = aRise / 15;
67
+ sinDec = 0.39782 * Math.sin(0.01745 * xlRise);
68
+ cosDec = Math.sqrt(1 - sinDec * sinDec);
69
+ hRise = (cosZen - sinDec * sinLat) / (cosDec * cosLat);
70
+ ahrSet = aSet / 15;
71
+ sinDec = 0.39782 * Math.sin(0.01745 * xlSet);
72
+ cosDec = Math.sqrt(1 - sinDec * sinDec);
73
+ hSet = (cosZen - sinDec * sinLat) / (cosDec * cosLat);
74
+ if (Math.abs(hRise) <= 1) {
75
+ hRise = 57.29578 * Math.acos(hRise);
76
+ utRise = ((360 - hRise) / 15) + ahrRise + Zmanim.adj(tRise) + lonHour;
77
+ sunrise = Zmanim.timeAdj(utRise + location.UTCOffset, date, location);
78
+ if (sunrise.hour > 12) {
79
+ sunrise.hour -= 12;
80
+ }
81
+ }
82
+ if (Math.abs(hSet) <= 1) {
83
+ hSet = 57.29578 * Math.acos(hSet);
84
+ utSet = (hRise / 15) + ahrSet + Zmanim.adj(tSet) + lonHour;
85
+ sunset = Zmanim.timeAdj(utSet + location.UTCOffset, date, location);
86
+ if (sunset.hour > 0 && sunset.hour < 12) {
87
+ sunset.hour += 12;
88
+ }
89
+ }
90
+ return { sunrise: sunrise, sunset: sunset };
91
+ }
92
+ /**
93
+ * @param {jDate | Date} date
94
+ * @param {Location} location
95
+ */
96
+ static getChatzos(date, location) {
97
+ return Zmanim.getChatzosFromSuntimes(Zmanim.getSunTimes(date, location, false));
98
+ }
99
+ /**
100
+ * @param {SunTimes} sunTimes
101
+ */
102
+ static getChatzosFromSuntimes(sunTimes) {
103
+ const rise = sunTimes.sunrise, set = sunTimes.sunset;
104
+ if (rise === undefined || isNaN(rise.hour) || set === undefined || isNaN(set.hour)) {
105
+ return { hour: NaN, minute: NaN };
106
+ }
107
+ const chatz = Utils_js_1.default.toInt((Utils_js_1.default.totalSeconds(set) - Utils_js_1.default.totalSeconds(rise)) / 2);
108
+ return Utils_js_1.default.addSeconds(rise, chatz);
109
+ }
110
+ /**
111
+ * @param {jDate | Date} date
112
+ * @param {Location} location
113
+ * @param {any} offset
114
+ */
115
+ static getShaaZmanis(date, location, offset) {
116
+ return Zmanim.getShaaZmanisFromSunTimes(Zmanim.getSunTimes(date, location, false), offset);
117
+ }
118
+ /**
119
+ * @param {{ sunrise: any; sunset: any; }} sunTimes
120
+ * @param {number} [offset]
121
+ */
122
+ static getShaaZmanisFromSunTimes(sunTimes, offset) {
123
+ if (!sunTimes || !sunTimes.sunrise || !sunTimes.sunset) {
124
+ return 0;
125
+ }
126
+ let rise = sunTimes.sunrise, set = sunTimes.sunset;
127
+ if (!rise || isNaN(rise.hour) || !set || isNaN(set.hour)) {
128
+ return NaN;
129
+ }
130
+ if (offset) {
131
+ rise = Utils_js_1.default.addMinutes(rise, -offset);
132
+ set = Utils_js_1.default.addMinutes(set, offset);
133
+ }
134
+ return (Utils_js_1.default.totalSeconds(set) - Utils_js_1.default.totalSeconds(rise)) / 720;
135
+ }
136
+ /**
137
+ * @param {{ sunrise: any; sunset: any; }} sunTimes
138
+ * @param {boolean} israel
139
+ */
140
+ static getShaaZmanisMga(sunTimes, israel) {
141
+ const minutes = israel ? 90 : 72;
142
+ let rise = sunTimes.sunrise && Utils_js_1.default.addMinutes(sunTimes.sunrise, -minutes), set = sunTimes.sunset && Utils_js_1.default.addMinutes(sunTimes.sunset, minutes);
143
+ if (!rise || isNaN(rise.hour) || !set || isNaN(set.hour)) {
144
+ return NaN;
145
+ }
146
+ return (Utils_js_1.default.totalSeconds(set) - Utils_js_1.default.totalSeconds(rise)) / 720;
147
+ }
148
+ /**
149
+ * @param {jDate | Date} date
150
+ * @param {Location} location
151
+ */
152
+ static getCandleLighting(date, location) {
153
+ return Zmanim.getCandleLightingFromSunTimes(Zmanim.getSunTimes(date, location), location);
154
+ }
155
+ /**
156
+ * @param {SunTimes} sunTimes
157
+ * @param {any} location
158
+ */
159
+ static getCandleLightingFromSunTimes(sunTimes, location) {
160
+ return sunTimes.sunset && Zmanim.getCandleLightingFromSunset(sunTimes.sunset, location);
161
+ }
162
+ /**
163
+ * @param {Time} sunset
164
+ * @param {Location} location
165
+ */
166
+ static getCandleLightingFromSunset(sunset, location) {
167
+ return Utils_js_1.default.addMinutes(sunset, -(location.CandleLighting || 0));
168
+ }
169
+ /**
170
+ * @param {Date} date
171
+ */
172
+ static dayOfYear(date) {
173
+ const month = date.getMonth(), isLeap = () => Utils_js_1.default.isSecularLeapYear(date.getFullYear()), yearDay = [0, 1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
174
+ return yearDay[month + 1] + date.getDate() + ((month > 1 && isLeap()) ? 1 : 0);
175
+ }
176
+ /**
177
+ * @param {number} deg
178
+ * @param {number} min
179
+ */
180
+ static degToDec(deg, min) {
181
+ return (deg + min / 60);
182
+ }
183
+ /**
184
+ * @param {number} x
185
+ */
186
+ static M(x) {
187
+ return (0.9856 * x - 3.251);
188
+ }
189
+ /**
190
+ * @param {number} x
191
+ */
192
+ static L(x) {
193
+ return (x + 1.916 * Math.sin(0.01745 * x) + 0.02 * Math.sin(2 * 0.01745 * x) + 282.565);
194
+ }
195
+ /**
196
+ * @param {number} x
197
+ */
198
+ static adj(x) {
199
+ return (-0.06571 * x - 6.62);
200
+ }
201
+ /**
202
+ * @param {number} rad
203
+ */
204
+ static radToDeg(rad) {
205
+ return 57.29578 * rad;
206
+ }
207
+ /**
208
+ * @param {number} time
209
+ * @param {Date} date
210
+ * @param {Location} location
211
+ */
212
+ static timeAdj(time, date, location) {
213
+ if (time < 0) {
214
+ time += 24;
215
+ }
216
+ let hour = Utils_js_1.default.toInt(time);
217
+ const minFloat = (time - hour) * 60 + 0.5, min = Utils_js_1.default.toInt(minFloat), sec = Math.round(60.0 * (minFloat - min));
218
+ if (Utils_js_1.default.isDST(location, date)) {
219
+ hour++;
220
+ }
221
+ return Utils_js_1.default.fixTime({ hour: hour, minute: min, second: sec });
222
+ }
223
+ }
224
+ exports.default = Zmanim;
@@ -0,0 +1,203 @@
1
+ import Sedra from './Sedra.js';
2
+ import Location from './Location';
3
+ /** Represents a single day in the Jewish Calendar. */
4
+ export default class jDate {
5
+ Day: number;
6
+ Month: number;
7
+ Year: number;
8
+ Abs: number;
9
+ /**
10
+ * Create a new Jdate.
11
+ * new jDate() - Sets the Jewish Date for the current system date
12
+ * new jDate(javascriptDateObject) - Sets to the Jewish date on the given Gregorian date
13
+ * new jDate("January 1 2045") - Accepts any valid javascript Date string (uses javascripts new Date(string))
14
+ * new jDate(jewishYear, jewishMonth, jewishDay) - Months start at 1. Nissan is month 1 Adar Sheini is 13.
15
+ * new jDate(jewishYear, jewishMonth) - Same as above, with Day defaulting to 1
16
+ * new jDate( { year: 5776, month: 4, day: 5 } ) - same as new jDate(jewishYear, jewishMonth, jewishDay)
17
+ * new jDate( { year: 5776, month: 4 } ) - same as new jDate(jewishYear, jewishMonth)
18
+ * new jDate( { year: 5776 } ) - sets to the first day of Rosh Hashana on the given year
19
+ * new jDate(absoluteDate) - The number of days elapsed since the theoretical date Sunday, December 31, 0001 BCE
20
+ * new jDate(jewishYear, jewishMonth, jewishDay, absoluteDate) - Most efficient constructor. Needs no calculations at all.
21
+ * new jDate( { year: 5776, month: 4, day: 5, abs: 122548708 } ) - same as new jDate(jewishYear, jewishMonth, jewishDay, absoluteDate)
22
+ * @param {number | Date | string | {year:number,month:number,day:number} | [number, number, number, number]} [arg] The full Jewish year number OR Javascript Date object or string OR object or array of year, month, day
23
+ * @param {number} [month] The month of the Jewish date. Nissan is 1.
24
+ * @param {number} [day] The day of the month
25
+ * @param {number} [abs] The number of days that have passed since 12/31/0001
26
+ */
27
+ constructor(arg?: number | Date | string | {
28
+ year: number;
29
+ month: number;
30
+ day: number;
31
+ } | [number, number, number, number], month?: number, day?: number, abs?: number);
32
+ /**Sets the current Jewish date from the given absolute date*/
33
+ fromAbs(absolute: number): void;
34
+ /**Returns a valid javascript Date object that represents the Gregorian date
35
+ that starts at midnight of the current Jewish date.*/
36
+ getDate(): Date;
37
+ /**
38
+ * @returns {number} The day of the week for the current Jewish date. Sunday is 0 and Shabbos is 6.
39
+ */
40
+ getDayOfWeek(): number;
41
+ /**
42
+ * @returns {number} The day of the week for the current Jewish date. Sunday is 0 and Shabbos is 6
43
+ */
44
+ get DayOfWeek(): number;
45
+ /**Returns a new Jewish date represented by adding the given number of days to the current Jewish date.*/
46
+ addDays(days: number): jDate;
47
+ /**
48
+ * Returns a new Jewish date represented by adding the given number of
49
+ * Jewish Months to the current Jewish date.
50
+ * If the current Day is 30 and the new month only has 29 days,
51
+ * the 29th day of the month is returned.
52
+ * @param {number} months
53
+ */
54
+ addMonths(months: number): jDate;
55
+ /**
56
+ * Returns a new Jewish date represented by adding the
57
+ * given number of Jewish Years to the current Jewish date.
58
+ * If the current Day is 30 and the new dates month only has 29 days,
59
+ * the 29th day of the month is returned.
60
+ * @param {number} years
61
+ */
62
+ addYears(years: number): jDate;
63
+ addSecularMonths(months: number): jDate;
64
+ addSecularYears(years: number): jDate;
65
+ /**Gets the number of days separating this Jewish Date and the given one.
66
+ *
67
+ * If the given date is before this one, the number will be negative.
68
+ * @param {jDate} jd
69
+ * */
70
+ diffDays(jd: jDate): number;
71
+ /**Gets the number of months separating this Jewish Date and the given one.
72
+ *
73
+ * Ignores the Day property:
74
+ *
75
+ * jDate.toJDate(5777, 6, 29).diffMonths(jDate.toJDate(5778, 7, 1)) will return 1 even though they are a day apart.
76
+ *
77
+ * If the given date is before this one, the number will be negative.
78
+ * @param {jDate} jd
79
+ * */
80
+ diffMonths(jd: jDate): number;
81
+ /**Gets the number of years separating this Jewish Date and the given one.
82
+ *
83
+ * Ignores the Day and Month properties:
84
+ *
85
+ * jDate.toJDate(5777, 6, 29).diffYears(jDate.toJDate(5778, 7, 1)) will return 1 even though they are a day apart.
86
+ *
87
+ * If the given date is before this one, the number will be negative.
88
+ * @param {jDate} jd*/
89
+ diffYears(jd: jDate): number;
90
+ /**
91
+ * Returns the current Jewish date in the format: Thursday, the 3rd of Kislev 5776.
92
+ * @param {boolean} hideDayOfWeek
93
+ * @param {boolean} dontCapitalize
94
+ */
95
+ toString(hideDayOfWeek?: boolean, dontCapitalize?: boolean): string;
96
+ /**
97
+ * Returns the current Jewish date in the format "[Tuesday] Nissan 3, 5778"
98
+ * @param {boolean} showDow - show day of week?
99
+ */
100
+ toShortstring(showDow: boolean): string;
101
+ /**
102
+ * Returns the current Jewish date in the format "Nissan 5778"
103
+ * @param {boolean} showYear - show the year number?
104
+ */
105
+ monthName(showYear?: boolean): string;
106
+ /**Returns the current Jewish date in the format: יום חמישי כ"א כסלו תשע"ו.*/
107
+ toStringHeb(): string;
108
+ /**Gets the day of the omer for the current Jewish date. If the date is not during sefira, 0 is returned.*/
109
+ getDayOfOmer(): number;
110
+ /**
111
+ * Returns true if this day is yomtov or chol hamoed
112
+ * @param {boolean} israel
113
+ */
114
+ isYomTovOrCholHamoed(israel: boolean): boolean;
115
+ /**
116
+ * Returns true if this day is yomtov
117
+ * @param {boolean} israel
118
+ */
119
+ isYomTov(israel: boolean): boolean;
120
+ /**Is today Erev Yom Tov? (includes Erev second days of Sukkos and Pesach) */
121
+ isErevYomTov(): boolean;
122
+ /**Does the current Jewish date have candle lighting before sunset?*/
123
+ hasCandleLighting(): boolean;
124
+ /**Is the current Jewish Date the day before a yomtov that contains a Friday?*/
125
+ hasEiruvTavshilin(israel: boolean): boolean;
126
+ /**Gets the candle lighting time for the current Jewish date for the given Location object.*/
127
+ getCandleLighting(location: Location, nullIfNoCandles: boolean): import("../jcal-zmanim").Time | null | undefined;
128
+ /**Get the sedra of the week for the current Jewish date.*/
129
+ getSedra(israel: boolean): Sedra;
130
+ /**Get the prakim of Pirkei Avos for the current Jewish date.*/
131
+ getPirkeiAvos(israel: boolean): number[];
132
+ /**Gets sunrise and sunset time for the current Jewish date at the given Location.
133
+ *
134
+ * Return format: {sunrise: {hour: 6, minute: 18}, sunset: {hour: 19, minute: 41}}*/
135
+ getSunriseSunset(location: Location, ignoreElevation?: boolean): import("../jcal-zmanim").SunTimes;
136
+ /**Gets Chatzos for both the day and the night for the current Jewish date at the given Location.
137
+ *
138
+ *Return format: {hour: 11, minute: 48}*/
139
+ getChatzos(location: Location): import("../jcal-zmanim").Time;
140
+ /**Gets the length of a single Sha'a Zmanis in minutes for the current Jewish date at the given Location.*/
141
+ getShaaZmanis(location: Location, offset: number): number;
142
+ /**Returns the daily daf in English. For example: Sukkah, Daf 3.*/
143
+ getDafYomi(): string;
144
+ /**Gets the daily daf in Hebrew. For example: 'סוכה דף כ.*/
145
+ getDafyomiHeb(): string;
146
+ /**
147
+ * Converts its argument/s to a Jewish Date.
148
+ * Samples of use:
149
+ * To get the current Jewish Date: jDate.toJDate(new Date()).
150
+ * To print out the current date in English: jDate.toJDate(new Date()).toString()
151
+ * To print out the current date in Hebrew: jDate.toJDate(new Date()).toStringHeb()
152
+ *
153
+ * Arguments to the jDate.toJDate function can be one of the following:
154
+ * jDate.toJDate() - Sets the Jewish Date for the current system date
155
+ * jDate.toJDate(Date) - Sets to the Jewish date on the given Javascript Date object
156
+ * jDate.toJDate("January 1 2045") - Accepts any valid Javascript Date string (uses string constructor of Date object)
157
+ * jDate.toJDate(jewishYear, jewishMonth, jewishDay) - Months start at 1. Nissan is month 1 Adara Sheini is 13.
158
+ * jDate.toJDate(jewishYear, jewishMonth) - Same as above, with Day defaulting to 1
159
+ * jDate.toJDate(jewishYear) - sets to the first day of Rosh Hashana on the given year
160
+ * jDate.toJDate( { year: 5776, month: 4, day: 5 } ) - Months start at 1. Nissan is month 1 Adara Sheini is 13.
161
+ * jDate.toJDate( { year: 5776, month: 4 } ) - Same as above, with Day defaulting to 1
162
+ * jDate.toJDate( { year: 5776 } ) - sets to the first day of Rosh Hashana on the given year
163
+ * jDate.toJDate(jewishYear, jewishMonth, jewishDay, absoluteDate) - Most efficient. Needs no calculations at all. The absoluteDate is the number of days elapsed since the theoretical date Sunday, December 31, 0001 BCE.
164
+ * jDate.toJDate( { year: 5776, month: 4, day: 5, abs: 122548708 } ) - same as jDate.toJDate(jewishYear, jewishMonth, jewishDay, absoluteDate)
165
+ ****************************************************************************************************************/
166
+ static toJDate(arg?: number | Date | string | {
167
+ year: number;
168
+ month: number;
169
+ day: number;
170
+ } | [number, number, number, number], month?: number, day?: number, abs?: number): jDate;
171
+ static now(): jDate;
172
+ /**Calculate the Jewish year, month and day for the given absolute date.*/
173
+ static fromAbs(absDay: number): {
174
+ year: number;
175
+ month: number;
176
+ day: number;
177
+ };
178
+ /**
179
+ * Gets the absolute date of the given javascript Date object.
180
+ * @param {Date} date
181
+ */
182
+ static absSd(date: Date): number;
183
+ /**Calculate the absolute date for the given Jewish Date.*/
184
+ static absJd(year: number, month: number, day: number): number;
185
+ /**
186
+ * Gets a javascript date from an absolute date
187
+ */
188
+ static sdFromAbs(abs: number): Date;
189
+ /**number of days in the given Jewish Month. Nissan is 1 and Adar Sheini is 13.*/
190
+ static daysJMonth(year: number, month: number): number;
191
+ /**Elapsed days since creation of the world until Rosh Hashana of the given year*/
192
+ static tDays(year: number): number;
193
+ /**number of days in the given Jewish Year.*/
194
+ static daysJYear(year: number): number;
195
+ /**Does Cheshvan for the given Jewish Year have 30 days?*/
196
+ static isLongCheshvan(year: number): boolean;
197
+ /**Does Kislev for the given Jewish Year have 29 days?*/
198
+ static isShortKislev(year: number): boolean;
199
+ /**Does the given Jewish Year have 13 months?*/
200
+ static isJdLeapY(year: number): boolean;
201
+ /**number of months in Jewish Year.*/
202
+ static monthsJYear(year: number): number;
203
+ }