jcal-zmanim 1.0.9 → 1.1.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/dist/JCal/Dafyomi.js +5 -5
- package/dist/JCal/Dafyomi.js.map +1 -1
- package/dist/JCal/Molad.d.ts +0 -1
- package/dist/JCal/Molad.d.ts.map +1 -1
- package/dist/JCal/Molad.js +15 -18
- package/dist/JCal/Molad.js.map +1 -1
- package/dist/JCal/PirkeiAvos.js +3 -3
- package/dist/JCal/PirkeiAvos.js.map +1 -1
- package/dist/JCal/Sedra.d.ts +1 -1
- package/dist/JCal/Sedra.js +1 -1
- package/dist/JCal/Zmanim.d.ts.map +1 -1
- package/dist/JCal/Zmanim.js +15 -16
- package/dist/JCal/Zmanim.js.map +1 -1
- package/dist/{AppUtils.d.ts → JCal/ZmanimUtils.d.ts} +8 -45
- package/dist/JCal/ZmanimUtils.d.ts.map +1 -0
- package/dist/{AppUtils.js → JCal/ZmanimUtils.js} +53 -123
- package/dist/JCal/ZmanimUtils.js.map +1 -0
- package/dist/JCal/jDate.d.ts +3 -3
- package/dist/JCal/jDate.js +23 -24
- package/dist/JCal/jDate.js.map +1 -1
- package/dist/Notifications.d.ts +9 -6
- package/dist/Notifications.d.ts.map +1 -1
- package/dist/Notifications.js +110 -130
- package/dist/Notifications.js.map +1 -1
- package/{README.md → dist/README.md} +227 -41
- package/dist/{JCal/Utils.d.ts → Utils.d.ts} +71 -10
- package/dist/Utils.d.ts.map +1 -0
- package/dist/{JCal/Utils.js → Utils.js} +175 -70
- package/dist/Utils.js.map +1 -0
- package/dist/index.js +13 -32
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
- package/dist/AppUtils.d.ts.map +0 -1
- package/dist/AppUtils.js.map +0 -1
- package/dist/GeneralUtils.d.ts +0 -44
- package/dist/GeneralUtils.d.ts.map +0 -1
- package/dist/GeneralUtils.js +0 -94
- package/dist/GeneralUtils.js.map +0 -1
- package/dist/JCal/Utils.d.ts.map +0 -1
- package/dist/JCal/Utils.js.map +0 -1
- package/dist/Settings.d.ts +0 -34
- package/dist/Settings.d.ts.map +0 -1
- package/dist/Settings.js +0 -84
- package/dist/Settings.js.map +0 -1
|
@@ -3,20 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WhichDaysFlags =
|
|
7
|
-
const Utils_1 =
|
|
8
|
-
const Zmanim_1 = __importDefault(require("./
|
|
9
|
-
const
|
|
10
|
-
const ZmanTypes_1 = require("./ZmanTypes");
|
|
11
|
-
exports.DaysOfWeek = Object.freeze({
|
|
12
|
-
SUNDAY: 0,
|
|
13
|
-
MONDAY: 1,
|
|
14
|
-
TUESDAY: 2,
|
|
15
|
-
WEDNESDAY: 3,
|
|
16
|
-
THURSDAY: 4,
|
|
17
|
-
FRIDAY: 5,
|
|
18
|
-
SHABBOS: 6,
|
|
19
|
-
});
|
|
6
|
+
exports.WhichDaysFlags = void 0;
|
|
7
|
+
const Utils_1 = require("../Utils");
|
|
8
|
+
const Zmanim_1 = __importDefault(require("./Zmanim"));
|
|
9
|
+
const ZmanTypes_1 = require("../ZmanTypes");
|
|
20
10
|
exports.WhichDaysFlags = Object.freeze({
|
|
21
11
|
SUNDAY: 1,
|
|
22
12
|
MONDAY: 2,
|
|
@@ -27,45 +17,7 @@ exports.WhichDaysFlags = Object.freeze({
|
|
|
27
17
|
SHABBOS: 64,
|
|
28
18
|
YOMTOV: 128,
|
|
29
19
|
});
|
|
30
|
-
class
|
|
31
|
-
/**
|
|
32
|
-
* Returns the date corrected time of the given zmanim on the given date at the given location
|
|
33
|
-
* If the zman is after or within 30 minutes of the given time, this days zman is returned, othwise tomorrows zman is returned.
|
|
34
|
-
* @param {Date} sdate
|
|
35
|
-
* @param {jDate} jdate
|
|
36
|
-
* @param {Time} time
|
|
37
|
-
* @param {Settings} settings
|
|
38
|
-
* @param {Time} sunset
|
|
39
|
-
* @returns {[{zmanType:ZmanToShow,time:Time, isTomorrow:boolean}]}
|
|
40
|
-
*/
|
|
41
|
-
static getCorrectZmanTimes(sdate, jdate, time, settings, sunset) {
|
|
42
|
-
const correctedTimes = [], zmanTypes = settings.zmanimToShow, location = settings.location, tomorrowJd = jdate.addDays(1), tomorrowSd = Utils_1.default.addDaysToSdate(sdate, 1),
|
|
43
|
-
/* Candle lighting and chometz times are not shown after sunset.
|
|
44
|
-
This solves the issue of Candle lighting showing as having "passed 20 minutes ago"
|
|
45
|
-
Thursday evening after sunset - which shows as hasCandleLighting = true
|
|
46
|
-
as it is already Friday... */
|
|
47
|
-
zmanTimes = AppUtils.getZmanTimes(zmanTypes.filter((zt) => ![21, 22, 23].includes(zt.id) || Utils_1.default.isTimeAfter(time, sunset)), sdate, jdate, location), tomorrowTimes = AppUtils.getZmanTimes(
|
|
48
|
-
//Candle lighting tomorrow is never shown...
|
|
49
|
-
zmanTypes.filter((zt) => zt.id !== 21), tomorrowSd, tomorrowJd, location);
|
|
50
|
-
for (let zt of zmanTimes) {
|
|
51
|
-
let oTime = zt.time, isTomorrow = false, diff = Utils_1.default.timeDiff(time, oTime, true);
|
|
52
|
-
if (diff.sign < 1 &&
|
|
53
|
-
Utils_1.default.totalMinutes(diff) >= settings.minToShowPassedZman) {
|
|
54
|
-
const tom = tomorrowTimes.find((t) => t.zmanType === zt.zmanType);
|
|
55
|
-
if (tom && tom.time) {
|
|
56
|
-
oTime = tom.time;
|
|
57
|
-
isTomorrow = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
correctedTimes.push({
|
|
61
|
-
zmanType: zt.zmanType,
|
|
62
|
-
time: oTime,
|
|
63
|
-
isTomorrow,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return correctedTimes.sort((a, b) => (a.isTomorrow ? 1 : -1) - (b.isTomorrow ? 1 : -1) ||
|
|
67
|
-
Utils_1.default.totalSeconds(a.time) - Utils_1.default.totalSeconds(b.time));
|
|
68
|
-
}
|
|
20
|
+
class ZmanimUtils {
|
|
69
21
|
/**
|
|
70
22
|
* Gets the zmanim for all the types in the given list.
|
|
71
23
|
* @param {[ZmanToShow]} zmanTypes An array of ZmanTypes to get the zman for.
|
|
@@ -75,8 +27,8 @@ class AppUtils {
|
|
|
75
27
|
* @returns{[{zmanType:{id:number,offset:?number,desc:string,eng:string,heb:string },time:Time}]}
|
|
76
28
|
*/
|
|
77
29
|
static getZmanTimes(zmanTypes, date, jdate, location) {
|
|
78
|
-
const mem =
|
|
79
|
-
z.location.Name === location.Name), zmanTimes = [], whichDay =
|
|
30
|
+
const mem = ZmanimUtils.zmanTimesCache.find((z) => Utils_1.Utils.isSameSdate(z.date, date) &&
|
|
31
|
+
z.location.Name === location.Name), zmanTimes = [], whichDay = ZmanimUtils.getWhichDays(date, jdate, location);
|
|
80
32
|
let sunrise, sunset, suntimesMishor, sunriseMishor, sunsetMishor, mishorNeg90, chatzos, shaaZmanis, shaaZmanisMga;
|
|
81
33
|
if (mem) {
|
|
82
34
|
sunrise = mem.sunrise;
|
|
@@ -96,7 +48,7 @@ class AppUtils {
|
|
|
96
48
|
suntimesMishor = Zmanim_1.default.getSunTimes(date, location, false);
|
|
97
49
|
sunriseMishor = suntimesMishor.sunrise;
|
|
98
50
|
sunsetMishor = suntimesMishor.sunset;
|
|
99
|
-
mishorNeg90 = Utils_1.
|
|
51
|
+
mishorNeg90 = Utils_1.Utils.addMinutes(sunriseMishor, -90);
|
|
100
52
|
chatzos =
|
|
101
53
|
sunriseMishor &&
|
|
102
54
|
sunsetMishor &&
|
|
@@ -109,7 +61,7 @@ class AppUtils {
|
|
|
109
61
|
sunriseMishor &&
|
|
110
62
|
sunsetMishor &&
|
|
111
63
|
Zmanim_1.default.getShaaZmanisMga(suntimesMishor, true);
|
|
112
|
-
|
|
64
|
+
ZmanimUtils.zmanTimesCache.push({
|
|
113
65
|
date,
|
|
114
66
|
location,
|
|
115
67
|
sunrise,
|
|
@@ -132,34 +84,34 @@ class AppUtils {
|
|
|
132
84
|
case ZmanTypes_1.ZmanTypeIds.ChatzosLayla: // chatzosNight
|
|
133
85
|
zmanTimes.push({
|
|
134
86
|
zmanType,
|
|
135
|
-
time: Utils_1.
|
|
87
|
+
time: Utils_1.Utils.addMinutes(chatzos, 720 + offset),
|
|
136
88
|
});
|
|
137
89
|
break;
|
|
138
90
|
case ZmanTypes_1.ZmanTypeIds.Alos90: // alos90
|
|
139
91
|
zmanTimes.push({
|
|
140
92
|
zmanType,
|
|
141
93
|
time: offset
|
|
142
|
-
? Utils_1.
|
|
94
|
+
? Utils_1.Utils.addMinutes(mishorNeg90, offset)
|
|
143
95
|
: mishorNeg90,
|
|
144
96
|
});
|
|
145
97
|
break;
|
|
146
98
|
case ZmanTypes_1.ZmanTypeIds.Alos72: // alos72
|
|
147
99
|
zmanTimes.push({
|
|
148
100
|
zmanType,
|
|
149
|
-
time: Utils_1.
|
|
101
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, -72 + offset),
|
|
150
102
|
});
|
|
151
103
|
break;
|
|
152
104
|
case ZmanTypes_1.ZmanTypeIds.TalisTefillin: //talisTefillin
|
|
153
105
|
zmanTimes.push({
|
|
154
106
|
zmanType,
|
|
155
|
-
time: Utils_1.
|
|
107
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, -36 + offset),
|
|
156
108
|
});
|
|
157
109
|
break;
|
|
158
110
|
case ZmanTypes_1.ZmanTypeIds.NetzAtElevation: //netzElevation
|
|
159
111
|
zmanTimes.push({
|
|
160
112
|
zmanType,
|
|
161
113
|
time: offset
|
|
162
|
-
? Utils_1.
|
|
114
|
+
? Utils_1.Utils.addMinutes(sunrise, offset)
|
|
163
115
|
: sunrise,
|
|
164
116
|
});
|
|
165
117
|
break;
|
|
@@ -167,7 +119,7 @@ class AppUtils {
|
|
|
167
119
|
zmanTimes.push({
|
|
168
120
|
zmanType,
|
|
169
121
|
time: offset
|
|
170
|
-
? Utils_1.
|
|
122
|
+
? Utils_1.Utils.addMinutes(sunriseMishor, offset)
|
|
171
123
|
: sunriseMishor,
|
|
172
124
|
});
|
|
173
125
|
break;
|
|
@@ -175,35 +127,35 @@ class AppUtils {
|
|
|
175
127
|
if (shaaZmanisMga)
|
|
176
128
|
zmanTimes.push({
|
|
177
129
|
zmanType,
|
|
178
|
-
time: Utils_1.
|
|
130
|
+
time: Utils_1.Utils.addMinutes(mishorNeg90, Math.floor(shaaZmanisMga * 3) + offset),
|
|
179
131
|
});
|
|
180
132
|
break;
|
|
181
133
|
case ZmanTypes_1.ZmanTypeIds.szksGra: //szksGra
|
|
182
134
|
if (shaaZmanis)
|
|
183
135
|
zmanTimes.push({
|
|
184
136
|
zmanType,
|
|
185
|
-
time: Utils_1.
|
|
137
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, Math.floor(shaaZmanis * 3) + offset),
|
|
186
138
|
});
|
|
187
139
|
break;
|
|
188
140
|
case ZmanTypes_1.ZmanTypeIds.sztMga: // sztMga
|
|
189
141
|
if (shaaZmanisMga)
|
|
190
142
|
zmanTimes.push({
|
|
191
143
|
zmanType,
|
|
192
|
-
time: Utils_1.
|
|
144
|
+
time: Utils_1.Utils.addMinutes(mishorNeg90, Math.floor(shaaZmanisMga * 4) + offset),
|
|
193
145
|
});
|
|
194
146
|
break;
|
|
195
147
|
case ZmanTypes_1.ZmanTypeIds.sztGra: //sztGra
|
|
196
148
|
if (shaaZmanis)
|
|
197
149
|
zmanTimes.push({
|
|
198
150
|
zmanType,
|
|
199
|
-
time: Utils_1.
|
|
151
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, Math.floor(shaaZmanis * 4) + offset),
|
|
200
152
|
});
|
|
201
153
|
break;
|
|
202
154
|
case ZmanTypes_1.ZmanTypeIds.chatzosDay: //chatzos
|
|
203
155
|
zmanTimes.push({
|
|
204
156
|
zmanType,
|
|
205
157
|
time: offset
|
|
206
|
-
? Utils_1.
|
|
158
|
+
? Utils_1.Utils.addMinutes(chatzos, offset)
|
|
207
159
|
: chatzos,
|
|
208
160
|
});
|
|
209
161
|
break;
|
|
@@ -211,28 +163,28 @@ class AppUtils {
|
|
|
211
163
|
if (shaaZmanis)
|
|
212
164
|
zmanTimes.push({
|
|
213
165
|
zmanType,
|
|
214
|
-
time: Utils_1.
|
|
166
|
+
time: Utils_1.Utils.addMinutes(chatzos, shaaZmanis * 0.5 + offset),
|
|
215
167
|
});
|
|
216
168
|
break;
|
|
217
169
|
case ZmanTypes_1.ZmanTypeIds.minKet: //minKet
|
|
218
170
|
if (shaaZmanis)
|
|
219
171
|
zmanTimes.push({
|
|
220
172
|
zmanType,
|
|
221
|
-
time: Utils_1.
|
|
173
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, shaaZmanis * 9.5 + offset),
|
|
222
174
|
});
|
|
223
175
|
break;
|
|
224
176
|
case ZmanTypes_1.ZmanTypeIds.plag: //plag
|
|
225
177
|
if (shaaZmanis)
|
|
226
178
|
zmanTimes.push({
|
|
227
179
|
zmanType,
|
|
228
|
-
time: Utils_1.
|
|
180
|
+
time: Utils_1.Utils.addMinutes(sunriseMishor, shaaZmanis * 10.75 + offset),
|
|
229
181
|
});
|
|
230
182
|
break;
|
|
231
183
|
case ZmanTypes_1.ZmanTypeIds.shkiaAtSeaLevel: //shkiaMishor
|
|
232
184
|
zmanTimes.push({
|
|
233
185
|
zmanType,
|
|
234
186
|
time: offset
|
|
235
|
-
? Utils_1.
|
|
187
|
+
? Utils_1.Utils.addMinutes(sunsetMishor, offset)
|
|
236
188
|
: sunsetMishor,
|
|
237
189
|
});
|
|
238
190
|
break;
|
|
@@ -240,57 +192,57 @@ class AppUtils {
|
|
|
240
192
|
zmanTimes.push({
|
|
241
193
|
zmanType,
|
|
242
194
|
time: offset
|
|
243
|
-
? Utils_1.
|
|
195
|
+
? Utils_1.Utils.addMinutes(sunset, offset)
|
|
244
196
|
: sunset,
|
|
245
197
|
});
|
|
246
198
|
break;
|
|
247
199
|
case ZmanTypes_1.ZmanTypeIds.tzais45: // tzais45
|
|
248
200
|
zmanTimes.push({
|
|
249
201
|
zmanType,
|
|
250
|
-
time: Utils_1.
|
|
202
|
+
time: Utils_1.Utils.addMinutes(sunset, 45 + offset),
|
|
251
203
|
});
|
|
252
204
|
break;
|
|
253
205
|
case ZmanTypes_1.ZmanTypeIds.tzais50: //tzais50
|
|
254
206
|
zmanTimes.push({
|
|
255
207
|
zmanType,
|
|
256
|
-
time: Utils_1.
|
|
208
|
+
time: Utils_1.Utils.addMinutes(sunset, 50 + offset),
|
|
257
209
|
});
|
|
258
210
|
break;
|
|
259
211
|
case ZmanTypes_1.ZmanTypeIds.tzais72: //tzais72
|
|
260
212
|
zmanTimes.push({
|
|
261
213
|
zmanType,
|
|
262
|
-
time: Utils_1.
|
|
214
|
+
time: Utils_1.Utils.addMinutes(sunset, 72 + offset),
|
|
263
215
|
});
|
|
264
216
|
break;
|
|
265
217
|
case ZmanTypes_1.ZmanTypeIds.rabbeinuTamZmanios: //tzais72Zmaniot
|
|
266
218
|
if (shaaZmanis)
|
|
267
219
|
zmanTimes.push({
|
|
268
220
|
zmanType,
|
|
269
|
-
time: Utils_1.
|
|
221
|
+
time: Utils_1.Utils.addMinutes(sunset, shaaZmanis * 1.2 + offset),
|
|
270
222
|
});
|
|
271
223
|
break;
|
|
272
224
|
case ZmanTypes_1.ZmanTypeIds.rabbeinuTamZmaniosMga: //tzais72ZmaniotMA
|
|
273
225
|
if (shaaZmanisMga)
|
|
274
226
|
zmanTimes.push({
|
|
275
227
|
zmanType,
|
|
276
|
-
time: Utils_1.
|
|
228
|
+
time: Utils_1.Utils.addMinutes(sunset, shaaZmanisMga * 1.2 + offset),
|
|
277
229
|
});
|
|
278
230
|
break;
|
|
279
231
|
case ZmanTypes_1.ZmanTypeIds.candleLighting: //candleLighting
|
|
280
232
|
if (sunset && jdate.hasCandleLighting()) {
|
|
281
233
|
zmanTimes.push({
|
|
282
234
|
zmanType,
|
|
283
|
-
time: Utils_1.
|
|
235
|
+
time: Utils_1.Utils.addMinutes(Zmanim_1.default.getCandleLightingFromSunset(sunset, location), offset),
|
|
284
236
|
});
|
|
285
237
|
}
|
|
286
238
|
break;
|
|
287
239
|
case ZmanTypes_1.ZmanTypeIds.SofZmanEatingChometz: //Sof Zman Achilas Chometz
|
|
288
240
|
if (shaaZmanisMga && jdate.Month === 1 &&
|
|
289
241
|
jdate.Day === 14 &&
|
|
290
|
-
Utils_1.
|
|
242
|
+
Utils_1.Utils.isTimeAfter(sunrise, Utils_1.Utils.timeFromDate(date))) {
|
|
291
243
|
zmanTimes.push({
|
|
292
244
|
zmanType,
|
|
293
|
-
time: Utils_1.
|
|
245
|
+
time: Utils_1.Utils.addMinutes(sunrise, -90 + offset + shaaZmanisMga * 4),
|
|
294
246
|
});
|
|
295
247
|
}
|
|
296
248
|
break;
|
|
@@ -298,12 +250,12 @@ class AppUtils {
|
|
|
298
250
|
if (shaaZmanisMga &&
|
|
299
251
|
jdate.Month === 1 &&
|
|
300
252
|
(jdate.Day === 14 ||
|
|
301
|
-
(jdate.DayOfWeek ===
|
|
253
|
+
(jdate.DayOfWeek === Utils_1.DaysOfWeek.FRIDAY &&
|
|
302
254
|
jdate.Day === 13)) &&
|
|
303
|
-
Utils_1.
|
|
255
|
+
Utils_1.Utils.isTimeAfter(sunrise, Utils_1.Utils.timeFromDate(date))) {
|
|
304
256
|
zmanTimes.push({
|
|
305
257
|
zmanType,
|
|
306
|
-
time: Utils_1.
|
|
258
|
+
time: Utils_1.Utils.addMinutes(sunrise, -90 + offset + shaaZmanisMga * 5),
|
|
307
259
|
});
|
|
308
260
|
}
|
|
309
261
|
break;
|
|
@@ -322,32 +274,32 @@ class AppUtils {
|
|
|
322
274
|
return exports.WhichDaysFlags.YOMTOV;
|
|
323
275
|
}
|
|
324
276
|
switch (date.getDay()) {
|
|
325
|
-
case
|
|
277
|
+
case Utils_1.DaysOfWeek.SUNDAY:
|
|
326
278
|
return exports.WhichDaysFlags.SUNDAY;
|
|
327
|
-
case
|
|
279
|
+
case Utils_1.DaysOfWeek.MONDAY:
|
|
328
280
|
return exports.WhichDaysFlags.MONDAY;
|
|
329
|
-
case
|
|
281
|
+
case Utils_1.DaysOfWeek.TUESDAY:
|
|
330
282
|
return exports.WhichDaysFlags.TUESDAY;
|
|
331
|
-
case
|
|
283
|
+
case Utils_1.DaysOfWeek.WEDNESDAY:
|
|
332
284
|
return exports.WhichDaysFlags.WEDNESDAY;
|
|
333
|
-
case
|
|
285
|
+
case Utils_1.DaysOfWeek.THURSDAY:
|
|
334
286
|
return exports.WhichDaysFlags.THURSDAY;
|
|
335
|
-
case
|
|
287
|
+
case Utils_1.DaysOfWeek.FRIDAY:
|
|
336
288
|
return exports.WhichDaysFlags.FRIDAY;
|
|
337
|
-
case
|
|
289
|
+
case Utils_1.DaysOfWeek.SHABBOS:
|
|
338
290
|
return exports.WhichDaysFlags.SHABBOS;
|
|
339
291
|
}
|
|
340
292
|
return 0;
|
|
341
293
|
}
|
|
342
294
|
/**
|
|
343
295
|
* Returns the zmanim necessary for showing basic shul notifications: chatzosHayom, chatzosHalayla, alos
|
|
344
|
-
* @param {jDate}
|
|
345
|
-
* @param {Date} sdate
|
|
296
|
+
* @param {jDate|Date} date
|
|
346
297
|
* @param {Location} location
|
|
347
298
|
* @returns {{chatzosHayom:Time, chatzosHalayla:Time, alos:Time, shkia:Time }}
|
|
348
299
|
*/
|
|
349
|
-
static getBasicShulZmanim(
|
|
350
|
-
const
|
|
300
|
+
static getBasicShulZmanim(date, location) {
|
|
301
|
+
const { sdate, jdate } = Utils_1.Utils.bothDates(date);
|
|
302
|
+
const zmanim = ZmanimUtils.getZmanTimes([
|
|
351
303
|
(0, ZmanTypes_1.getZmanType)(ZmanTypes_1.ZmanTypeIds.chatzosDay),
|
|
352
304
|
(0, ZmanTypes_1.getZmanType)(ZmanTypes_1.ZmanTypeIds.Alos90),
|
|
353
305
|
(0, ZmanTypes_1.getZmanType)(ZmanTypes_1.ZmanTypeIds.shkiaElevation),
|
|
@@ -355,7 +307,7 @@ class AppUtils {
|
|
|
355
307
|
], sdate, jdate, location);
|
|
356
308
|
return {
|
|
357
309
|
chatzosHayom: zmanim[0].time,
|
|
358
|
-
chatzosHalayla: Utils_1.
|
|
310
|
+
chatzosHalayla: Utils_1.Utils.addMinutes(zmanim[0].time, 720),
|
|
359
311
|
alos: zmanim[1].time,
|
|
360
312
|
shkia: zmanim[2].time,
|
|
361
313
|
};
|
|
@@ -367,32 +319,10 @@ class AppUtils {
|
|
|
367
319
|
* @returns {{zmanType:ZmanToShow, time?:Time }[]}
|
|
368
320
|
*/
|
|
369
321
|
static getAllZmanim(date, location) {
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
: date;
|
|
373
|
-
return AppUtils.getZmanTimes(ZmanTypes_1.ZmanTypes, jd.getDate(), jd, location);
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Compares two zmanim for showing to see if they are the same
|
|
377
|
-
* @param {{id:number,offset:?Number, whichDaysFlags:?Number, desc: String, eng: String, heb: String }} zman1
|
|
378
|
-
* @param {{id:number,offset:?Number, whichDaysFlags:?Number, desc: String, eng: String, heb: String }} zman2
|
|
379
|
-
*/
|
|
380
|
-
static IsSameZmanToShow(zman1, zman2) {
|
|
381
|
-
return (zman1.id === zman2.id &&
|
|
382
|
-
zman1.desc === zman2.desc &&
|
|
383
|
-
zman1.eng === zman2.eng &&
|
|
384
|
-
zman1.heb === zman2.heb &&
|
|
385
|
-
(zman1.offset || 0) === (zman2.offset || 0) &&
|
|
386
|
-
(zman1.whichDaysFlags || 0) === (zman2.whichDaysFlags || 0));
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Returns all available ZmanTypes - including baseTypes and custom added types
|
|
390
|
-
* @param {Settings} settings
|
|
391
|
-
*/
|
|
392
|
-
static AllZmanTypes(settings) {
|
|
393
|
-
return [...ZmanTypes_1.ZmanTypes] /*.concat(settings.customZmanim)*/;
|
|
322
|
+
const { sdate, jdate } = Utils_1.Utils.bothDates(date);
|
|
323
|
+
return ZmanimUtils.getZmanTimes(ZmanTypes_1.ZmanTypes, sdate, jdate, location);
|
|
394
324
|
}
|
|
395
325
|
}
|
|
396
|
-
|
|
397
|
-
exports.default =
|
|
398
|
-
//# sourceMappingURL=
|
|
326
|
+
ZmanimUtils.zmanTimesCache = [];
|
|
327
|
+
exports.default = ZmanimUtils;
|
|
328
|
+
//# sourceMappingURL=ZmanimUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ZmanimUtils.js","sourceRoot":"","sources":["../../src/JCal/ZmanimUtils.ts"],"names":[],"mappings":";;;;;;AAAA,oCAA2C;AAC3C,sDAA8B;AAG9B,4CAAmE;AAgBtD,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,GAAG;CACd,CAAC,CAAC;AAEH,MAAqB,WAAW;IAG5B;;;;;;;OAOG;IACH,MAAM,CAAC,YAAY,CAAC,SAAuB,EAAE,IAAU,EAAE,KAAY,EAAE,QAAkB;QACrF,MAAM,GAAG,GAAG,WAAW,CAAC,cAAc,CAAC,IAAI,CACvC,CAAC,CAAC,EAAE,EAAE,CACF,aAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC;YAC/B,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,CACxC,EACG,SAAS,GAA4C,EAAE,EACvD,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC/D,IAAI,OAAyB,EACzB,MAAwB,EACxB,cAAoC,EACpC,a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QAAkB;QAC5D,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,aAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,WAAW,CAAC,YAAY,CACnC;YACI,IAAA,uBAAW,EAAC,uBAAW,CAAC,UAAU,CAAe;YACjD,IAAA,uBAAW,EAAC,uBAAW,CAAC,MAAM,CAAe;YAC7C,IAAA,uBAAW,EAAC,uBAAW,CAAC,cAAc,CAAe;YACrD,IAAA,uBAAW,EAAC,uBAAW,CAAC,cAAc,CAAe;SACxD,EACD,KAAK,EACL,KAAK,EACL,QAAQ,CACX,CAAC;QACF,OAAO;YACH,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAC5B,cAAc,EAAE,aAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC;YACrD,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YACpB,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;SACxB,CAAC;IACN,CAAC;IAED;;;;;MAKE;IACF,MAAM,CAAC,YAAY,CAAC,IAAkB,EAAE,QAAkB;QACtD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,aAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/C,OAAO,WAAW,CAAC,YAAY,CAAC,qBAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAE,CAAC;IACxE,CAAC;;AA7WM,0BAAc,GAAe,EAAE,CAAC;kBADtB,WAAW"}
|
package/dist/JCal/jDate.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export default class jDate {
|
|
|
124
124
|
/**Is the current Jewish Date the day before a yomtov that contains a Friday?*/
|
|
125
125
|
hasEiruvTavshilin(israel: boolean): boolean;
|
|
126
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;
|
|
127
|
+
getCandleLighting(location: Location, nullIfNoCandles: boolean): import("../jcal-zmanim.js").Time | null | undefined;
|
|
128
128
|
/**Get the sedra of the week for the current Jewish date.*/
|
|
129
129
|
getSedra(israel: boolean): Sedra;
|
|
130
130
|
/**Get the prakim of Pirkei Avos for the current Jewish date.*/
|
|
@@ -132,11 +132,11 @@ export default class jDate {
|
|
|
132
132
|
/**Gets sunrise and sunset time for the current Jewish date at the given Location.
|
|
133
133
|
*
|
|
134
134
|
* Return format: {sunrise: {hour: 6, minute: 18}, sunset: {hour: 19, minute: 41}}*/
|
|
135
|
-
getSunriseSunset(location: Location, ignoreElevation?: boolean): import("../jcal-zmanim").SunTimes;
|
|
135
|
+
getSunriseSunset(location: Location, ignoreElevation?: boolean): import("../jcal-zmanim.js").SunTimes;
|
|
136
136
|
/**Gets Chatzos for both the day and the night for the current Jewish date at the given Location.
|
|
137
137
|
*
|
|
138
138
|
*Return format: {hour: 11, minute: 48}*/
|
|
139
|
-
getChatzos(location: Location): import("../jcal-zmanim").Time;
|
|
139
|
+
getChatzos(location: Location): import("../jcal-zmanim.js").Time;
|
|
140
140
|
/**Gets the length of a single Sha'a Zmanis in minutes for the current Jewish date at the given Location.*/
|
|
141
141
|
getShaaZmanis(location: Location, offset: number): number;
|
|
142
142
|
/**Returns the daily daf in English. For example: Sukkah, Daf 3.*/
|
package/dist/JCal/jDate.js
CHANGED
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const Utils_js_1 = __importDefault(require("./Utils.js"));
|
|
6
|
+
const Utils_js_1 = require("../Utils.js");
|
|
8
7
|
const Sedra_js_1 = __importDefault(require("./Sedra.js"));
|
|
9
8
|
const PirkeiAvos_js_1 = __importDefault(require("./PirkeiAvos.js"));
|
|
10
9
|
const Zmanim_js_1 = __importDefault(require("./Zmanim.js"));
|
|
@@ -55,7 +54,7 @@ class jDate {
|
|
|
55
54
|
this.fromAbs(jDate.absSd(new Date()));
|
|
56
55
|
}
|
|
57
56
|
else if (arg instanceof Date) {
|
|
58
|
-
if (
|
|
57
|
+
if (Utils_js_1.Utils.isValidDate(arg)) {
|
|
59
58
|
this.fromAbs(jDate.absSd(arg));
|
|
60
59
|
}
|
|
61
60
|
else {
|
|
@@ -70,9 +69,9 @@ class jDate {
|
|
|
70
69
|
(arg.length > 3 && arg[3]) ||
|
|
71
70
|
jDate.absJd(this.Year, this.Month, this.Day);
|
|
72
71
|
}
|
|
73
|
-
else if (arg &&
|
|
72
|
+
else if (arg && Utils_js_1.Utils.isString(arg)) {
|
|
74
73
|
const d = new Date(arg);
|
|
75
|
-
if (
|
|
74
|
+
if (Utils_js_1.Utils.isValidDate(d)) {
|
|
76
75
|
this.fromAbs(jDate.absSd(d));
|
|
77
76
|
}
|
|
78
77
|
else {
|
|
@@ -81,7 +80,7 @@ class jDate {
|
|
|
81
80
|
'" cannot be parsed into a Date');
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
else if (
|
|
83
|
+
else if (Utils_js_1.Utils.isNumber(arg)) {
|
|
85
84
|
//if no other arguments were supplied, we assume that the supplied number is an absolute date
|
|
86
85
|
if (arguments.length === 1) {
|
|
87
86
|
this.fromAbs(arg);
|
|
@@ -98,7 +97,7 @@ class jDate {
|
|
|
98
97
|
//If arg is an object that has a "year" property that contains a valid value...
|
|
99
98
|
else if (typeof arg === 'object') {
|
|
100
99
|
const argObj = arg;
|
|
101
|
-
if (
|
|
100
|
+
if (Utils_js_1.Utils.isNumber(argObj.year)) {
|
|
102
101
|
this.Day = argObj.day || 1;
|
|
103
102
|
this.Month = argObj.month || 7;
|
|
104
103
|
this.Year = argObj.year;
|
|
@@ -270,9 +269,9 @@ class jDate {
|
|
|
270
269
|
? dontCapitalize
|
|
271
270
|
? 't'
|
|
272
271
|
: 'T'
|
|
273
|
-
: Utils_js_1.
|
|
272
|
+
: Utils_js_1.DaysOfWeekEng[this.getDayOfWeek()] + ', t') +
|
|
274
273
|
'he ' +
|
|
275
|
-
Utils_js_1.
|
|
274
|
+
Utils_js_1.Utils.toSuffixed(this.Day) +
|
|
276
275
|
' of ' +
|
|
277
276
|
this.monthName());
|
|
278
277
|
}
|
|
@@ -281,8 +280,8 @@ class jDate {
|
|
|
281
280
|
* @param {boolean} showDow - show day of week?
|
|
282
281
|
*/
|
|
283
282
|
toShortstring(showDow) {
|
|
284
|
-
return ((showDow ? Utils_js_1.
|
|
285
|
-
Utils_js_1.
|
|
283
|
+
return ((showDow ? Utils_js_1.DaysOfWeekEng[this.getDayOfWeek()] + ' ' : '') +
|
|
284
|
+
Utils_js_1.JewishMonthsEng[this.Month] +
|
|
286
285
|
' ' +
|
|
287
286
|
this.Day.toString() +
|
|
288
287
|
', ' +
|
|
@@ -293,18 +292,18 @@ class jDate {
|
|
|
293
292
|
* @param {boolean} showYear - show the year number?
|
|
294
293
|
*/
|
|
295
294
|
monthName(showYear = true) {
|
|
296
|
-
return (Utils_js_1.
|
|
295
|
+
return (Utils_js_1.JewishMonthsEng[this.Month] +
|
|
297
296
|
(showYear ? ' ' + this.Year.toString() : ''));
|
|
298
297
|
}
|
|
299
298
|
/**Returns the current Jewish date in the format: יום חמישי כ"א כסלו תשע"ו.*/
|
|
300
299
|
toStringHeb() {
|
|
301
|
-
return (Utils_js_1.
|
|
300
|
+
return (Utils_js_1.DaysOfWeekHeb[this.getDayOfWeek()] +
|
|
302
301
|
' ' +
|
|
303
|
-
Utils_js_1.
|
|
302
|
+
Utils_js_1.Utils.toJewishNumber(this.Day) +
|
|
304
303
|
' ' +
|
|
305
|
-
Utils_js_1.
|
|
304
|
+
Utils_js_1.JewishMonthsHeb[this.Month] +
|
|
306
305
|
' ' +
|
|
307
|
-
Utils_js_1.
|
|
306
|
+
Utils_js_1.Utils.toJewishNumber(this.Year % 1000));
|
|
308
307
|
}
|
|
309
308
|
/**Gets the day of the omer for the current Jewish date. If the date is not during sefira, 0 is returned.*/
|
|
310
309
|
getDayOfOmer() {
|
|
@@ -355,10 +354,10 @@ class jDate {
|
|
|
355
354
|
}
|
|
356
355
|
/**Is today Erev Yom Tov? (includes Erev second days of Sukkos and Pesach) */
|
|
357
356
|
isErevYomTov() {
|
|
358
|
-
return ((this.Month === 1 &&
|
|
357
|
+
return ((this.Month === 1 && Utils_js_1.Utils.has(this.Day, 14, 20)) ||
|
|
359
358
|
(this.Month === 3 && this.Day === 5) ||
|
|
360
359
|
(this.Month === 6 && this.Day === 29) ||
|
|
361
|
-
(this.Month === 7 &&
|
|
360
|
+
(this.Month === 7 && Utils_js_1.Utils.has(this.Day, 9, 14, 21)));
|
|
362
361
|
}
|
|
363
362
|
/**Does the current Jewish date have candle lighting before sunset?*/
|
|
364
363
|
hasCandleLighting() {
|
|
@@ -468,7 +467,7 @@ class jDate {
|
|
|
468
467
|
// If just the year is set, then the date is set to Rosh Hashana of that year.
|
|
469
468
|
// In the above scenario, we can't just pass the args along, as the constructor will treat it as an absolute date.
|
|
470
469
|
//...and that folks, is actually the whole point of this function...
|
|
471
|
-
else if (
|
|
470
|
+
else if (Utils_js_1.Utils.isNumber(arg) && arguments.length === 1) {
|
|
472
471
|
return new jDate(arg, 7, 1);
|
|
473
472
|
}
|
|
474
473
|
else {
|
|
@@ -481,7 +480,7 @@ class jDate {
|
|
|
481
480
|
/**Calculate the Jewish year, month and day for the given absolute date.*/
|
|
482
481
|
static fromAbs(absDay) {
|
|
483
482
|
//To save on calculations, start with a few years before date
|
|
484
|
-
let year = 3761 + Utils_js_1.
|
|
483
|
+
let year = 3761 + Utils_js_1.Utils.toInt(absDay / (absDay > 0 ? 366 : 300)), month, day;
|
|
485
484
|
// Search forward for year from the approximation year.
|
|
486
485
|
while (absDay >= jDate.absJd(year + 1, 7, 1)) {
|
|
487
486
|
year++;
|
|
@@ -590,13 +589,13 @@ class jDate {
|
|
|
590
589
|
if (cached) {
|
|
591
590
|
return cached.elapsed;
|
|
592
591
|
}
|
|
593
|
-
const months = Utils_js_1.
|
|
592
|
+
const months = Utils_js_1.Utils.toInt(235 * Utils_js_1.Utils.toInt((year - 1) / 19) + // Leap months this cycle
|
|
594
593
|
12 * ((year - 1) % 19) + // Regular months in this cycle.
|
|
595
594
|
(7 * ((year - 1) % 19) + 1) / 19), // Months in complete cycles so far.
|
|
596
595
|
parts = 204 + 793 * (months % 1080), hours = 5 +
|
|
597
596
|
12 * months +
|
|
598
|
-
793 * Utils_js_1.
|
|
599
|
-
Utils_js_1.
|
|
597
|
+
793 * Utils_js_1.Utils.toInt(months / 1080) +
|
|
598
|
+
Utils_js_1.Utils.toInt(parts / 1080), conjDay = Utils_js_1.Utils.toInt(1 + 29 * months + hours / 24), conjParts = 1080 * (hours % 24) + (parts % 1080);
|
|
600
599
|
let altDay;
|
|
601
600
|
/* at the end of a leap year - 15 hours, 589 parts or later... -
|
|
602
601
|
... or is on a Monday at... - ...of a common year, -
|
|
@@ -616,7 +615,7 @@ class jDate {
|
|
|
616
615
|
altDay = conjDay;
|
|
617
616
|
}
|
|
618
617
|
// A day is added if Rosh HaShanah would occur on Sunday, Friday or Wednesday,
|
|
619
|
-
if (
|
|
618
|
+
if (Utils_js_1.Utils.has(altDay % 7, 0, 3, 5)) {
|
|
620
619
|
altDay += 1;
|
|
621
620
|
}
|
|
622
621
|
//Add this year to the cache to save on calculations later on
|