@hebcal/core 5.4.2 → 5.4.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.
@@ -1,6 +1,6 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { Event } from './event';
3
- import '../src/locale';
3
+ import './locale';
4
4
  /** Daily Hebrew date ("11th of Sivan, 5780") */
5
5
  export declare class HebrewDateEvent extends Event {
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { Event } from './event';
3
3
  import { TimedEvent } from './TimedEvent';
4
- import '../src/locale';
4
+ import './locale';
5
5
  /** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */
6
6
  export declare class HolidayEvent extends Event {
7
7
  /** During Sukkot or Pesach */
@@ -1,6 +1,6 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { Event } from './event';
3
- import '../src/locale';
3
+ import './locale';
4
4
  /** Represents Mevarchim haChodesh, the announcement of the new month */
5
5
  export declare class MevarchimChodeshEvent extends Event {
6
6
  readonly monthName: string;
@@ -1,6 +1,6 @@
1
1
  import { Event } from './event';
2
2
  import { HDate } from '@hebcal/hdate';
3
- import '../src/locale';
3
+ import './locale';
4
4
  /**
5
5
  * Represents one of 54 weekly Torah portions, always on a Saturday
6
6
  */
@@ -2,7 +2,7 @@ import { HDate } from '@hebcal/hdate';
2
2
  import { CalOptions } from './CalOptions';
3
3
  import { Location } from './location';
4
4
  import { Event } from './event';
5
- import '../src/locale';
5
+ import './locale';
6
6
  /** An event that has an `eventTime` and `eventTimeStr` */
7
7
  export declare class TimedEvent extends Event {
8
8
  readonly eventTime: Date;
@@ -1,6 +1,6 @@
1
1
  import { HDate } from '@hebcal/hdate';
2
2
  import { HolidayEvent } from './HolidayEvent';
3
- import '../src/locale';
3
+ import './locale';
4
4
  export declare const ykk = "Yom Kippur Katan";
5
5
  /** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */
6
6
  export declare class YomKippurKatanEvent extends HolidayEvent {
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.4.2 */
1
+ /*! @hebcal/core v5.4.4 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -9432,6 +9432,12 @@ class Zmanim {
9432
9432
  }
9433
9433
  /**
9434
9434
  * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
9435
+ *
9436
+ * This method returns the latest *zman tfila* (time to recite shema in the morning)
9437
+ * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
9438
+ * (depending on the `useElevation` setting), according
9439
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
9440
+ *
9435
9441
  * If elevation is enabled, this function will include elevation in the calculation.
9436
9442
  * @return {Date}
9437
9443
  */
@@ -9441,19 +9447,16 @@ class Zmanim {
9441
9447
  /**
9442
9448
  * Returns an array with alot (Date) and ms in hour (number)
9443
9449
  * @private
9444
- * @return {any[]}
9445
9450
  */
9446
- getTemporalHour72() {
9447
- const alot72 = this.sunriseOffset(-72, false, true);
9448
- const tzeit72 = this.sunsetOffset(72, false, true);
9451
+ getTemporalHour72(forceSeaLevel) {
9452
+ const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
9453
+ const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);
9449
9454
  const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;
9450
9455
  return [alot72, temporalHour];
9451
9456
  }
9452
9457
  /**
9453
9458
  * Returns an array with alot (Date) and ms in hour (number)
9454
9459
  * @private
9455
- * @param {number} angle
9456
- * @return {any[]}
9457
9460
  */
9458
9461
  getTemporalHourByDeg(angle) {
9459
9462
  const alot = this.timeAtAngle(angle, true);
@@ -9469,8 +9472,9 @@ class Zmanim {
9469
9472
  * @return {Date}
9470
9473
  */
9471
9474
  sofZmanShmaMGA() {
9472
- const [alot72, temporalHour] = this.getTemporalHour72();
9473
- return new Date(alot72.getTime() + (3 * temporalHour));
9475
+ const [alot72, temporalHour] = this.getTemporalHour72(true);
9476
+ const offset = Math.floor(3 * temporalHour);
9477
+ return new Date(alot72.getTime() + offset);
9474
9478
  }
9475
9479
  /**
9476
9480
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
@@ -9480,7 +9484,8 @@ class Zmanim {
9480
9484
  */
9481
9485
  sofZmanShmaMGA16Point1() {
9482
9486
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
9483
- return new Date(alot.getTime() + (3 * temporalHour));
9487
+ const offset = Math.floor(3 * temporalHour);
9488
+ return new Date(alot.getTime() + offset);
9484
9489
  }
9485
9490
  /**
9486
9491
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
@@ -9494,15 +9499,17 @@ class Zmanim {
9494
9499
  */
9495
9500
  sofZmanShmaMGA19Point8() {
9496
9501
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
9497
- return new Date(alot.getTime() + (3 * temporalHour));
9502
+ const offset = Math.floor(3 * temporalHour);
9503
+ return new Date(alot.getTime() + offset);
9498
9504
  }
9499
9505
  /**
9500
9506
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
9501
9507
  * @return {Date}
9502
9508
  */
9503
9509
  sofZmanTfillaMGA() {
9504
- const [alot72, temporalHour] = this.getTemporalHour72();
9505
- return new Date(alot72.getTime() + (4 * temporalHour));
9510
+ const [alot72, temporalHour] = this.getTemporalHour72(true);
9511
+ const offset = Math.floor(4 * temporalHour);
9512
+ return new Date(alot72.getTime() + offset);
9506
9513
  }
9507
9514
  /**
9508
9515
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
@@ -9512,7 +9519,8 @@ class Zmanim {
9512
9519
  */
9513
9520
  sofZmanTfillaMGA16Point1() {
9514
9521
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
9515
- return new Date(alot.getTime() + (4 * temporalHour));
9522
+ const offset = Math.floor(4 * temporalHour);
9523
+ return new Date(alot.getTime() + offset);
9516
9524
  }
9517
9525
  /**
9518
9526
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
@@ -9526,24 +9534,67 @@ class Zmanim {
9526
9534
  */
9527
9535
  sofZmanTfillaMGA19Point8() {
9528
9536
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
9529
- return new Date(alot.getTime() + (4 * temporalHour));
9537
+ const offset = Math.floor(4 * temporalHour);
9538
+ return new Date(alot.getTime() + offset);
9530
9539
  }
9531
9540
  /**
9532
- * Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours.
9541
+ * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
9533
9542
  * If elevation is enabled, this function will include elevation in the calculation.
9543
+ *
9544
+ * This method returns the latest mincha gedola, the earliest time one can pray mincha
9545
+ * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
9546
+ * (depending on the `useElevation` setting), according
9547
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
9548
+ *
9549
+ * The Ramba"m is of the opinion that it is better to delay *mincha* until
9550
+ * *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
9551
+ * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
9534
9552
  * @return {Date}
9535
9553
  */
9536
9554
  minchaGedola() {
9537
9555
  return this.getShaahZmanisBasedZman(6.5);
9538
9556
  }
9557
+ /**
9558
+ * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.
9559
+ * If elevation is enabled, this function will include elevation in the calculation.
9560
+ *
9561
+ * This method returns the time of *mincha gedola* according to the Magen Avraham
9562
+ * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
9563
+ * This is the earliest time to pray *mincha*.
9564
+ * @return {Date}
9565
+ */
9566
+ minchaGedolaMGA() {
9567
+ const [alot72, temporalHour] = this.getTemporalHour72(false);
9568
+ const offset = Math.floor(6.5 * temporalHour);
9569
+ return new Date(alot72.getTime() + offset);
9570
+ }
9539
9571
  /**
9540
9572
  * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.
9541
9573
  * If elevation is enabled, this function will include elevation in the calculation.
9574
+ *
9575
+ * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the
9576
+ * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,
9577
+ * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
9578
+ * (depending on the `useElevation` setting), according
9579
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
9542
9580
  * @return {Date}
9543
9581
  */
9544
9582
  minchaKetana() {
9545
9583
  return this.getShaahZmanisBasedZman(9.5);
9546
9584
  }
9585
+ /**
9586
+ * This method returns the time of *mincha ketana* according to the Magen Avraham
9587
+ * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
9588
+ * This is the preferred earliest time to pray *mincha* according to the opinion of
9589
+ * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
9590
+ *
9591
+ * If elevation is enabled, this function will include elevation in the calculation.
9592
+ * @return {Date}
9593
+ */
9594
+ minchaKetanaMGA() {
9595
+ const [alot72, temporalHour] = this.getTemporalHour72(false);
9596
+ return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));
9597
+ }
9547
9598
  /**
9548
9599
  * Plag haMincha; Sunrise plus 10.75 halachic hours.
9549
9600
  * If elevation is enabled, this function will include elevation in the calculation.
@@ -10486,7 +10537,7 @@ class Sedra {
10486
10537
  const weekNum = (saturday - this.firstSaturday) / 7;
10487
10538
  const index = this.theSedraArray[weekNum];
10488
10539
  if (typeof index === 'undefined') {
10489
- const sedra = new Sedra(this.year + 1, this.il);
10540
+ const sedra = getSedra_(this.year + 1, this.il);
10490
10541
  return sedra.lookup(saturday); // must be next year
10491
10542
  }
10492
10543
  if (typeof index === 'string') {
@@ -11375,7 +11426,7 @@ class DailyLearning {
11375
11426
  }
11376
11427
 
11377
11428
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
11378
- const version = '5.4.2';
11429
+ const version = '5.4.4';
11379
11430
 
11380
11431
  /* eslint-disable max-len */
11381
11432
  /**
@@ -12231,20 +12282,7 @@ function checkCandleOptions(options) {
12231
12282
  }
12232
12283
  let min = Number(options.candleLightingMins) || 18;
12233
12284
  if (location.getIsrael() && Math.abs(min) === 18) {
12234
- const geoid = location.getGeoId();
12235
- if (geoid) {
12236
- const offset = geoIdCandleOffset[geoid];
12237
- if (typeof offset === 'number') {
12238
- min = offset;
12239
- }
12240
- }
12241
- const shortName = location.getShortName();
12242
- if (shortName) {
12243
- const offset = israelCityOffset[shortName];
12244
- if (typeof offset === 'number') {
12245
- min = offset;
12246
- }
12247
- }
12285
+ min = overrideIsraelCandleMins(location, min);
12248
12286
  }
12249
12287
  options.candleLightingMins = -1 * Math.abs(min);
12250
12288
  if (typeof options.havdalahMins === 'number') {
@@ -12260,6 +12298,23 @@ function checkCandleOptions(options) {
12260
12298
  options.fastEndDeg = TZEIT_3MEDIUM_STARS;
12261
12299
  }
12262
12300
  }
12301
+ function overrideIsraelCandleMins(location, min) {
12302
+ const geoid = location.getGeoId();
12303
+ if (geoid) {
12304
+ const offset = geoIdCandleOffset[geoid];
12305
+ if (typeof offset === 'number') {
12306
+ return offset;
12307
+ }
12308
+ }
12309
+ const shortName = location.getShortName();
12310
+ if (shortName) {
12311
+ const offset = israelCityOffset[shortName];
12312
+ if (typeof offset === 'number') {
12313
+ return offset;
12314
+ }
12315
+ }
12316
+ return min;
12317
+ }
12263
12318
  /**
12264
12319
  * Mask to filter Holiday array
12265
12320
  * @private