null will be returned. See detailed explanation on top of the page.
* @see #CIVIL_ZENITH
*/
- public getBeginCivilTwilight(): DateTime | null {
+ public getBeginCivilTwilight(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(AstronomicalCalendar.CIVIL_ZENITH);
}
@@ -152,7 +152,7 @@ export class AstronomicalCalendar {
* calculation can't be computed null will be returned. See detailed explanation on top of the page.
* @see #NAUTICAL_ZENITH
*/
- public getBeginNauticalTwilight(): DateTime | null {
+ public getBeginNauticalTwilight(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(AstronomicalCalendar.NAUTICAL_ZENITH);
}
@@ -165,7 +165,7 @@ export class AstronomicalCalendar {
* calculation can't be computed, null will be returned. See detailed explanation on top of the page.
* @see #ASTRONOMICAL_ZENITH
*/
- public getBeginAstronomicalTwilight(): DateTime | null {
+ public getBeginAstronomicalTwilight(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(AstronomicalCalendar.ASTRONOMICAL_ZENITH);
}
@@ -188,7 +188,7 @@ export class AstronomicalCalendar {
* @see #getSeaLevelSunset()
* @see AstronomicalCalendar#getUTCSunset
*/
- public getSunset(): DateTime | null {
+ public getSunset(): Temporal.ZonedDateTime | null {
const sunset: number = this.getUTCSunset(AstronomicalCalendar.GEOMETRIC_ZENITH);
if (Number.isNaN(sunset)) return null;
return this.getDateFromTime(sunset, AstronomicalCalendar.SolarEvent.SUNSET);
@@ -207,7 +207,7 @@ export class AstronomicalCalendar {
* @see AstronomicalCalendar#getUTCSeaLevelSunset
* @see #getSunset()
*/
- public getSeaLevelSunset(): DateTime | null {
+ public getSeaLevelSunset(): Temporal.ZonedDateTime | null {
const sunset: number = this.getUTCSeaLevelSunset(AstronomicalCalendar.GEOMETRIC_ZENITH);
if (Number.isNaN(sunset)) return null;
return this.getDateFromTime(sunset, AstronomicalCalendar.SolarEvent.SUNSET);
@@ -221,7 +221,7 @@ export class AstronomicalCalendar {
* the calculation can't be computed, null will be returned. See detailed explanation on top of the page.
* @see #CIVIL_ZENITH
*/
- public getEndCivilTwilight(): DateTime | null {
+ public getEndCivilTwilight(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(AstronomicalCalendar.CIVIL_ZENITH);
}
@@ -233,7 +233,7 @@ export class AstronomicalCalendar {
* page.
* @see #NAUTICAL_ZENITH
*/
- public getEndNauticalTwilight(): DateTime | null {
+ public getEndNauticalTwilight(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(AstronomicalCalendar.NAUTICAL_ZENITH);
}
@@ -245,7 +245,7 @@ export class AstronomicalCalendar {
* of the page.
* @see #ASTRONOMICAL_ZENITH
*/
- public getEndAstronomicalTwilight(): DateTime | null {
+ public getEndAstronomicalTwilight(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(AstronomicalCalendar.ASTRONOMICAL_ZENITH);
}
@@ -261,12 +261,12 @@ export class AstronomicalCalendar {
* the offset in milliseconds to add to the time.
* @return the {@link java.util.Date} with the offset in milliseconds added to it
*/
- public static getTimeOffset(time: DateTime | null, offset: number): DateTime | null {
+ public static getTimeOffset(time: Temporal.ZonedDateTime | null, offset: number): Temporal.ZonedDateTime | null {
if (time === null || offset === Long_MIN_VALUE || Number.isNaN(offset)) {
return null;
}
- return time.plus({ milliseconds: offset });
+ return time.add({ milliseconds: Math.trunc(offset) });
}
/**
@@ -284,7 +284,7 @@ export class AstronomicalCalendar {
* not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
* page.
*/
- public getSunriseOffsetByDegrees(offsetZenith: number): DateTime | null {
+ public getSunriseOffsetByDegrees(offsetZenith: number): Temporal.ZonedDateTime | null {
const dawn: number = this.getUTCSunrise(offsetZenith);
if (Number.isNaN(dawn)) return null;
return this.getDateFromTime(dawn, AstronomicalCalendar.SolarEvent.SUNRISE);
@@ -304,7 +304,7 @@ export class AstronomicalCalendar {
* rise, and one where it does not set, a null will be returned. See detailed explanation on top of the
* page.
*/
- public getSunsetOffsetByDegrees(offsetZenith: number): DateTime | null {
+ public getSunsetOffsetByDegrees(offsetZenith: number): Temporal.ZonedDateTime | null {
const sunset: number = this.getUTCSunset(offsetZenith);
if (Number.isNaN(sunset)) return null;
return this.getDateFromTime(sunset, AstronomicalCalendar.SolarEvent.SUNSET);
@@ -333,7 +333,7 @@ export class AstronomicalCalendar {
* @see #ComplexZmanimCalendar(GeoLocation)
*/
constructor(geoLocation: GeoLocation = new GeoLocation()) {
- this.setDate(DateTime.fromObject({ zone: geoLocation.getTimeZone() }));
+ this.setDate(Temporal.Now.plainDateISO());
this.setGeoLocation(geoLocation); // duplicate call
this.setAstronomicalCalculator(new NOAACalculator());
}
@@ -445,12 +445,12 @@ export class AstronomicalCalendar {
*
* @see #getTemporalHour()
*/
- public getTemporalHour(startOfDay: DateTime | null = this.getSeaLevelSunrise(),
- endOfDay: DateTime | null = this.getSeaLevelSunset()): number {
+ public getTemporalHour(startOfDay: Temporal.ZonedDateTime | null = this.getSeaLevelSunrise(),
+ endOfDay: Temporal.ZonedDateTime | null = this.getSeaLevelSunset()): number {
if (startOfDay === null || endOfDay === null) {
return Long_MIN_VALUE;
}
- return (endOfDay.valueOf() - startOfDay.valueOf()) / 12;
+ return (endOfDay.epochMilliseconds - startOfDay.epochMilliseconds) / 12;
}
/**
@@ -495,16 +495,16 @@ export class AstronomicalCalendar {
* @see com.kosherjava.zmanim.util.NOAACalculator#getUTCNoon(Calendar, GeoLocation)
* @see com.kosherjava.zmanim.util.SunTimesCalculator#getUTCNoon(Calendar, GeoLocation)
*/
- public getSunTransit(): DateTime | null;
- public getSunTransit(startOfDay: DateTime | null, endOfDay: DateTime | null): DateTime | null;
- public getSunTransit(startOfDay?: DateTime | null, endOfDay?: DateTime | null): DateTime | null {
+ public getSunTransit(): Temporal.ZonedDateTime | null;
+ public getSunTransit(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null;
+ public getSunTransit(startOfDay?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null): Temporal.ZonedDateTime | null {
if (startOfDay === undefined && endOfDay === undefined) {
const noon = this.getAstronomicalCalculator().getUTCNoon(this.getAdjustedDate(), this.getGeoLocation());
return this.getDateFromTime(noon, AstronomicalCalendar.SolarEvent.NOON);
}
const temporalHour: number = this.getTemporalHour(startOfDay, endOfDay);
- return AstronomicalCalendar.getTimeOffset(startOfDay as DateTime | null, temporalHour * 6);
+ return AstronomicalCalendar.getTimeOffset(startOfDay as Temporal.ZonedDateTime | null, temporalHour * 6);
}
/**
@@ -535,7 +535,7 @@ export class AstronomicalCalendar {
* @see com.kosherjava.zmanim.util.NOAACalculator#getUTCNoon(Calendar, GeoLocation)
* @see com.kosherjava.zmanim.util.SunTimesCalculator#getUTCNoon(Calendar, GeoLocation)
*/
- public getSunLowerTransit(): DateTime | null {
+ public getSunLowerTransit(): Temporal.ZonedDateTime | null {
return this.getSolarMidnight();
}
@@ -564,7 +564,7 @@ export class AstronomicalCalendar {
* @see com.kosherjava.zmanim.util.NOAACalculator#getUTCNoon(Calendar, GeoLocation)
* @see com.kosherjava.zmanim.util.SunTimesCalculator#getUTCNoon(Calendar, GeoLocation)
*/
- public getSolarMidnight(): DateTime | null {
+ public getSolarMidnight(): Temporal.ZonedDateTime | null {
const noon: number = this.getAstronomicalCalculator().getUTCMidnight(this.getAdjustedDate(), this.getGeoLocation());
return this.getDateFromTime(noon, AstronomicalCalendar.SolarEvent.MIDNIGHT);
}
@@ -592,14 +592,14 @@ export class AstronomicalCalendar {
* @param solarEvent - the type of {@link SolarEvent}
* @return The Date - object representation of the time double
*/
- protected getDateFromTime(time: number, solarEvent: ValueOfThis class extends ZmanimCalendar and provides many more zmanim than available in the ZmanimCalendar. The basis
* for most zmanim in this class are from the sefer Yisroel
@@ -778,7 +782,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getPlagHamincha26Degrees()
* @see #getPlagHamincha120Minutes()
*/
- public getPlagHamincha120MinutesZmanis(): DateTime | null {
+ public getPlagHamincha120MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos120Zmanis(), this.getTzais120Zmanis(), true);
}
@@ -802,7 +806,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis120Minutes()
* @see #getPlagHamincha26Degrees()
*/
- public getPlagHamincha120Minutes(): DateTime | null {
+ public getPlagHamincha120Minutes(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos120(), this.getTzais120(), true);
}
@@ -838,7 +842,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getPlagHamincha60Minutes()
* @see #getShaahZmanis60Minutes()
*/
- public getAlos60(): DateTime | null {
+ public getAlos60(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), -60 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -858,7 +862,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getShaahZmanisGra()
*/
- public getAlos72Zmanis(): DateTime | null {
+ public getAlos72Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(-1.2);
}
@@ -877,7 +881,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* a null will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- public getAlos96(): DateTime | null {
+ public getAlos96(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), -96 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -897,7 +901,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getShaahZmanisGra()
*/
- public getAlos90Zmanis(): DateTime | null {
+ public getAlos90Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(-1.5);
}
@@ -917,7 +921,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getShaahZmanisGra()
*/
- public getAlos96Zmanis(): DateTime | null {
+ public getAlos96Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(-1.6);
}
@@ -935,7 +939,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* a null will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- public getAlos90(): DateTime | null {
+ public getAlos90(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), -90 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -963,7 +967,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais120()
* @see #getAlos26Degrees()
*/
- public getAlos120(): DateTime | null {
+ public getAlos120(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -992,7 +996,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos120()
* @see #getAlos26Degrees()
*/
- public getAlos120Zmanis(): DateTime | null {
+ public getAlos120Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(-2);
}
@@ -1020,7 +1024,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais120()
* @see #getTzais26Degrees()
*/
- public getAlos26Degrees(): DateTime | null {
+ public getAlos26Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_26_DEGREES);
}
@@ -1034,7 +1038,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #ASTRONOMICAL_ZENITH
*/
- public getAlos18Degrees(): DateTime | null {
+ public getAlos18Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ASTRONOMICAL_ZENITH);
}
@@ -1053,7 +1057,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #ASTRONOMICAL_ZENITH
*/
- public getAlos19Degrees(): DateTime | null {
+ public getAlos19Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_19_DEGREES);
}
@@ -1072,7 +1076,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #ZENITH_19_POINT_8
* @see #getAlos90()
*/
- public getAlos19Point8Degrees(): DateTime | null {
+ public getAlos19Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_19_POINT_8);
}
@@ -1091,7 +1095,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #ZENITH_16_POINT_1
* @see #getAlos72()
*/
- public getAlos16Point1Degrees(): DateTime | null {
+ public getAlos16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_16_POINT_1);
}
@@ -1110,7 +1114,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #ZENITH_11_POINT_5
*/
- public getMisheyakir11Point5Degrees(): DateTime | null {
+ public getMisheyakir11Point5Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_11_POINT_5);
}
@@ -1128,7 +1132,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #ZENITH_11_DEGREES
*/
- public getMisheyakir11Degrees(): DateTime | null {
+ public getMisheyakir11Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_11_DEGREES);
}
@@ -1146,7 +1150,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #ZENITH_10_POINT_2
*/
- public getMisheyakir10Point2Degrees(): DateTime | null {
+ public getMisheyakir10Point2Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_10_POINT_2);
}
@@ -1179,7 +1183,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #ZENITH_7_POINT_65
* @see #getMisheyakir9Point5Degrees()
*/
- public getMisheyakir7Point65Degrees(): DateTime | null {
+ public getMisheyakir7Point65Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_7_POINT_65);
}
@@ -1207,7 +1211,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #ZENITH_9_POINT_5
* @see #getMisheyakir7Point65Degrees()
*/
- public getMisheyakir9Point5Degrees(): DateTime | null {
+ public getMisheyakir9Point5Degrees(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_9_POINT_5);
}
@@ -1227,7 +1231,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis19Point8Degrees()
* @see #getAlos19Point8Degrees()
*/
- public getSofZmanShmaMGA19Point8Degrees(): DateTime | null {
+ public getSofZmanShmaMGA19Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos19Point8Degrees(), this.getTzais19Point8Degrees(), true);
}
@@ -1247,7 +1251,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis16Point1Degrees()
* @see #getAlos16Point1Degrees()
*/
- public getSofZmanShmaMGA16Point1Degrees(): DateTime | null {
+ public getSofZmanShmaMGA16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos16Point1Degrees(), this.getTzais16Point1Degrees(), true);
}
@@ -1267,7 +1271,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis18Degrees()
* @see #getAlos18Degrees()
*/
- public getSofZmanShmaMGA18Degrees(): DateTime | null {
+ public getSofZmanShmaMGA18Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos18Degrees(), this.getTzais18Degrees(), true);
}
@@ -1290,7 +1294,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos72()
* @see #getSofZmanShmaMGA()
*/
- public getSofZmanShmaMGA72Minutes(): DateTime | null {
+ public getSofZmanShmaMGA72Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanShmaMGA();
}
@@ -1313,7 +1317,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos72Zmanis()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA72MinutesZmanis(): DateTime | null {
+ public getSofZmanShmaMGA72MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos72Zmanis(), this.getTzais72Zmanis(), true);
}
@@ -1334,7 +1338,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos90()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA90Minutes(): DateTime | null {
+ public getSofZmanShmaMGA90Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos90(), this.getTzais90(), true);
}
@@ -1356,7 +1360,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos90Zmanis()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA90MinutesZmanis(): DateTime | null {
+ public getSofZmanShmaMGA90MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos90Zmanis(), this.getTzais90Zmanis(), true);
}
@@ -1377,7 +1381,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos96()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA96Minutes(): DateTime | null {
+ public getSofZmanShmaMGA96Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos96(), this.getTzais96(), true);
}
@@ -1399,7 +1403,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos96Zmanis()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA96MinutesZmanis(): DateTime | null {
+ public getSofZmanShmaMGA96MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos96Zmanis(), this.getTzais96Zmanis(), true);
}
@@ -1430,7 +1434,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getSofZmanTfila2HoursBeforeChatzos()
* @see #isUseAstronomicalChatzos()
*/
- public getSofZmanShma3HoursBeforeChatzos(): DateTime | null {
+ public getSofZmanShma3HoursBeforeChatzos(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), -180 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -1452,7 +1456,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos120()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanShmaMGA120Minutes(): DateTime | null {
+ public getSofZmanShmaMGA120Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos120(), this.getTzais120(), true);
}
@@ -1478,7 +1482,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos16Point1Degrees()
* @see #getSeaLevelSunset()
*/
- public getSofZmanShmaAlos16Point1ToSunset(): DateTime | null {
+ public getSofZmanShmaAlos16Point1ToSunset(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos16Point1Degrees(), this.getElevationAdjustedSunset());
}
@@ -1501,7 +1505,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos16Point1Degrees()
* @see #getTzaisGeonim7Point083Degrees()
*/
- public getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees(): DateTime | null {
+ public getSofZmanShmaAlos16Point1ToTzaisGeonim7Point083Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos16Point1Degrees(), this.getTzaisGeonim7Point083Degrees());
}
@@ -1521,12 +1525,12 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* the Yisrael Vehazmanim was based on a misunderstanding and should not be used. This deprecated method
* will be removed pending confirmation from Rabbi Harfenes.
*/
- public getSofZmanShmaKolEliyahu(): DateTime | null {
- const chatzos: DateTime | null = this.getFixedLocalChatzos();
+ public getSofZmanShmaKolEliyahu(): Temporal.ZonedDateTime | null {
+ const chatzos: Temporal.ZonedDateTime | null = this.getFixedLocalChatzos();
if (chatzos === null || this.getSunrise() === null) {
return null;
}
- const diff: number = (chatzos.valueOf() - this.getElevationAdjustedSunrise()!.valueOf()) / 2;
+ const diff: number = (chatzos.epochMilliseconds - this.getElevationAdjustedSunrise()!.epochMilliseconds) / 2;
return ComplexZmanimCalendar.getTimeOffset(chatzos, -diff);
}
@@ -1548,7 +1552,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos19Point8Degrees()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getSofZmanTfilaMGA19Point8Degrees(): DateTime | null {
+ public getSofZmanTfilaMGA19Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos19Point8Degrees(), this.getTzais19Point8Degrees(), true);
}
@@ -1569,7 +1573,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis16Point1Degrees()
* @see #getAlos16Point1Degrees()
*/
- public getSofZmanTfilaMGA16Point1Degrees(): DateTime | null {
+ public getSofZmanTfilaMGA16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos16Point1Degrees(), this.getTzais16Point1Degrees(), true);
}
@@ -1590,7 +1594,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis18Degrees()
* @see #getAlos18Degrees()
*/
- public getSofZmanTfilaMGA18Degrees(): DateTime | null {
+ public getSofZmanTfilaMGA18Degrees(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos18Degrees(), this.getTzais18Degrees(), true);
}
@@ -1612,7 +1616,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos72()
* @see #getSofZmanShmaMGA()
*/
- public getSofZmanTfilaMGA72Minutes(): DateTime | null {
+ public getSofZmanTfilaMGA72Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfilaMGA();
}
@@ -1632,7 +1636,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis72MinutesZmanis()
* @see #getAlos72Zmanis()
*/
- public getSofZmanTfilaMGA72MinutesZmanis(): DateTime | null {
+ public getSofZmanTfilaMGA72MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos72Zmanis(), this.getTzais72Zmanis(), true);
}
@@ -1652,7 +1656,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis90Minutes()
* @see #getAlos90()
*/
- public getSofZmanTfilaMGA90Minutes(): DateTime | null {
+ public getSofZmanTfilaMGA90Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos90(), this.getTzais90(), true);
}
@@ -1673,7 +1677,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis90MinutesZmanis()
* @see #getAlos90Zmanis()
*/
- public getSofZmanTfilaMGA90MinutesZmanis(): DateTime | null {
+ public getSofZmanTfilaMGA90MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos90Zmanis(), this.getTzais90Zmanis(), true);
}
@@ -1693,7 +1697,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis96Minutes()
* @see #getAlos96()
*/
- public getSofZmanTfilaMGA96Minutes(): DateTime | null {
+ public getSofZmanTfilaMGA96Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos96(), this.getTzais96(), true);
}
@@ -1714,7 +1718,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis90MinutesZmanis()
* @see #getAlos90Zmanis()
*/
- public getSofZmanTfilaMGA96MinutesZmanis(): DateTime | null {
+ public getSofZmanTfilaMGA96MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos96Zmanis(), this.getTzais96Zmanis(), true);
}
@@ -1735,7 +1739,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis120Minutes()
* @see #getAlos120()
*/
- public getSofZmanTfilaMGA120Minutes(): DateTime | null {
+ public getSofZmanTfilaMGA120Minutes(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos120(), this.getTzais120(), true);
}
@@ -1752,7 +1756,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see ZmanimCalendar#getChatzos()
* @see #getSofZmanShma3HoursBeforeChatzos()
*/
- public getSofZmanTfila2HoursBeforeChatzos(): DateTime | null {
+ public getSofZmanTfila2HoursBeforeChatzos(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -1779,7 +1783,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #isUseAstronomicalChatzos()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getMinchaGedola30Minutes(): DateTime | null {
+ public getMinchaGedola30Minutes(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), ComplexZmanimCalendar.MINUTE_MILLIS * 30);
}
@@ -1804,7 +1808,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaGedola72Minutes(): DateTime | null {
+ public getMinchaGedola72Minutes(): Temporal.ZonedDateTime | null {
if (this.isUseAstronomicalChatzosForOtherZmanim()) {
return this.getHalfDayBasedZman(this.getChatzos(), this.getTzais72(), 0.5);
}
@@ -1828,7 +1832,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* the sun may not reach low enough below the horizon for this calculation, a null will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getMinchaGedola16Point1Degrees(): DateTime | null {
+ public getMinchaGedola16Point1Degrees(): Temporal.ZonedDateTime | null {
if (this.isUseAstronomicalChatzosForOtherZmanim()) {
return this.getHalfDayBasedZman(this.getChatzos(), this.getTzais16Point1Degrees(), 0.5);
}
@@ -1857,15 +1861,13 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanisAlos16Point1ToTzais3Point7()
* @see #getMinchaGedolaGreaterThan30()
*/
- public getMinchaGedolaAhavatShalom(): DateTime | null {
+ public getMinchaGedolaAhavatShalom(): Temporal.ZonedDateTime | null {
if (this.getChatzos() === null || this.getMinchaGedola30Minutes() === null
|| this.getShaahZmanisAlos16Point1ToTzais3Point7() === Long_MIN_VALUE) {
return null;
}
- return this.getMinchaGedola30Minutes()! > ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), this.getShaahZmanisAlos16Point1ToTzais3Point7() / 2)!
- ? this.getMinchaGedola30Minutes()
- : ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), this.getShaahZmanisAlos16Point1ToTzais3Point7() / 2);
+ return zdtMax(this.getMinchaGedola30Minutes()!, ComplexZmanimCalendar.getTimeOffset(this.getChatzos(), this.getShaahZmanisAlos16Point1ToTzais3Point7() / 2)!);
}
/**
@@ -1884,12 +1886,12 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMinchaGedola30Minutes()
* @see #isUseAstronomicalChatzos()
*/
- public getMinchaGedolaGreaterThan30(): DateTime | null {
+ public getMinchaGedolaGreaterThan30(): Temporal.ZonedDateTime | null {
if (this.getMinchaGedola30Minutes() === null || this.getMinchaGedola() === null) {
return null;
}
- return DateTime.max(this.getMinchaGedola30Minutes()!, this.getMinchaGedola()!);
+ return zdtMax(this.getMinchaGedola30Minutes()!, this.getMinchaGedola()!);
}
/**
@@ -1909,7 +1911,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* where the sun may not reach low enough below the horizon for this calculation, a null will be
* returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getMinchaKetana16Point1Degrees(): DateTime | null {
+ public getMinchaKetana16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getMinchaKetana(this.getAlos16Point1Degrees(), this.getTzais16Point1Degrees(), true);
}
@@ -1932,7 +1934,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMinchaGedolaAhavatShalom()
* @see #getPlagAhavatShalom()
*/
- public getMinchaKetanaAhavatShalom(): DateTime | null {
+ public getMinchaKetanaAhavatShalom(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getTzaisGeonim3Point8Degrees(), -this.getShaahZmanisAlos16Point1ToTzais3Point8() * 2.5);
}
@@ -1952,7 +1954,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaKetana72Minutes(): DateTime | null {
+ public getMinchaKetana72Minutes(): Temporal.ZonedDateTime | null {
return this.getMinchaKetana(this.getAlos72(), this.getTzais72(), true);
}
@@ -1970,7 +1972,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos60()
* @see #getTzais60()
*/
- public getPlagHamincha60Minutes(): DateTime | null {
+ public getPlagHamincha60Minutes(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos60(), this.getTzais60(), true);
}
@@ -1993,7 +1995,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getShaahZmanis72Minutes()
*/
- public getPlagHamincha72Minutes(): DateTime | null {
+ public getPlagHamincha72Minutes(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos72(), this.getTzais72(), true);
}
@@ -2016,7 +2018,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getShaahZmanis90Minutes()
*/
- public getPlagHamincha90Minutes(): DateTime | null {
+ public getPlagHamincha90Minutes(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos90(), this.getTzais90(), true);
}
@@ -2038,7 +2040,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #getShaahZmanis96Minutes()
*/
- public getPlagHamincha96Minutes(): DateTime | null {
+ public getPlagHamincha96Minutes(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos96(), this.getTzais96(), true);
}
@@ -2058,7 +2060,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getPlagHamincha96MinutesZmanis(): DateTime | null {
+ public getPlagHamincha96MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos96Zmanis(), this.getTzais96Zmanis(), true);
}
@@ -2078,7 +2080,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getPlagHamincha90MinutesZmanis(): DateTime | null {
+ public getPlagHamincha90MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos90Zmanis(), this.getTzais90Zmanis(), true);
}
@@ -2098,7 +2100,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getPlagHamincha72MinutesZmanis(): DateTime | null {
+ public getPlagHamincha72MinutesZmanis(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos72Zmanis(), this.getTzais72Zmanis(), true);
}
@@ -2122,7 +2124,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getShaahZmanis16Point1Degrees()
*/
- public getPlagHamincha16Point1Degrees(): DateTime | null {
+ public getPlagHamincha16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos16Point1Degrees(), this.getTzais16Point1Degrees(), true);
}
@@ -2146,7 +2148,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getShaahZmanis19Point8Degrees()
*/
- public getPlagHamincha19Point8Degrees(): DateTime | null {
+ public getPlagHamincha19Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos19Point8Degrees(), this.getTzais19Point8Degrees(), true);
}
@@ -2171,7 +2173,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis26Degrees()
* @see #getPlagHamincha120Minutes()
*/
- public getPlagHamincha26Degrees(): DateTime | null {
+ public getPlagHamincha26Degrees(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos26Degrees(), this.getTzais26Degrees(), true);
}
@@ -2195,7 +2197,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getShaahZmanis18Degrees()
*/
- public getPlagHamincha18Degrees(): DateTime | null {
+ public getPlagHamincha18Degrees(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos18Degrees(), this.getTzais18Degrees(), true);
}
@@ -2218,7 +2220,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos16Point1Degrees()
* @see #getSeaLevelSunset()
*/
- public getPlagAlosToSunset(): DateTime | null {
+ public getPlagAlosToSunset(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos16Point1Degrees(), this.getElevationAdjustedSunset());
}
@@ -2240,7 +2242,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos16Point1Degrees()
* @see #getTzaisGeonim7Point083Degrees()
*/
- public getPlagAlos16Point1ToTzaisGeonim7Point083Degrees(): DateTime | null {
+ public getPlagAlos16Point1ToTzaisGeonim7Point083Degrees(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos16Point1Degrees(), this.getTzaisGeonim7Point083Degrees());
}
@@ -2261,7 +2263,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMinchaGedolaAhavatShalom()
* @see #getMinchaKetanaAhavatShalom()
*/
- public getPlagAhavatShalom(): DateTime | null {
+ public getPlagAhavatShalom(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getTzaisGeonim3Point8Degrees(), -this.getShaahZmanisAlos16Point1ToTzais3Point8() * 1.25);
}
@@ -2289,7 +2291,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #ZENITH_13_POINT_24
* @see #getBainHashmashosRT58Point5Minutes()
*/
- public getBainHashmashosRT13Point24Degrees(): DateTime | null {
+ public getBainHashmashosRT13Point24Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_13_POINT_24);
}
@@ -2297,7 +2299,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* Misspelled method name that should be {@link #getBainHashmashosRT13Point24Degrees()}.
* @return the properly spelled version.
*/
- public getBainHasmashosRT13Point24Degrees(): DateTime | null {
+ public getBainHasmashosRT13Point24Degrees(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosRT13Point24Degrees();
}
@@ -2313,7 +2315,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
*
*/
- public getBainHashmashosRT58Point5Minutes(): DateTime | null {
+ public getBainHashmashosRT58Point5Minutes(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 58.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2322,7 +2324,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosRT58Point5Minutes(): DateTime | null {
+ public getBainHasmashosRT58Point5Minutes(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosRT58Point5Minutes();
}
@@ -2338,7 +2340,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #getTzaisGeonim7Point083Degrees()
*/
- public getBainHashmashosRT13Point5MinutesBefore7Point083Degrees(): DateTime | null {
+ public getBainHashmashosRT13Point5MinutesBefore7Point083Degrees(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_7_POINT_083), -13.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2347,7 +2349,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosRT13Point5MinutesBefore7Point083Degrees(): DateTime | null {
+ public getBainHasmashosRT13Point5MinutesBefore7Point083Degrees(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosRT13Point5MinutesBefore7Point083Degrees();
}
@@ -2363,14 +2365,14 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* calculation, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getBainHashmashosRT2Stars(): DateTime | null {
- const alos19Point8: DateTime | null = this.getAlos19Point8Degrees();
- const sunrise: DateTime | null = this.getElevationAdjustedSunrise();
+ public getBainHashmashosRT2Stars(): Temporal.ZonedDateTime | null {
+ const alos19Point8: Temporal.ZonedDateTime | null = this.getAlos19Point8Degrees();
+ const sunrise: Temporal.ZonedDateTime | null = this.getElevationAdjustedSunrise();
if (alos19Point8 === null || sunrise === null) {
return null;
}
- return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), (sunrise.valueOf() - alos19Point8.valueOf()) * (5 / 18));
+ return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), (sunrise.epochMilliseconds - alos19Point8.epochMilliseconds) * (5 / 18));
}
/**
@@ -2378,7 +2380,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosRT2Stars(): DateTime | null {
+ public getBainHasmashosRT2Stars(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosRT2Stars();
}
@@ -2395,7 +2397,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #getBainHashmashosYereim3Point05Degrees()
*/
- public getBainHashmashosYereim18Minutes(): DateTime | null {
+ public getBainHashmashosYereim18Minutes(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), -18 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2404,7 +2406,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim18Minutes(): DateTime | null {
+ public getBainHasmashosYereim18Minutes(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim18Minutes();
}
@@ -2438,7 +2440,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getBainHashmashosYereim2Point8Degrees()
* @see #getBainHashmashosYereim2Point1Degrees()
*/
- public getBainHashmashosYereim3Point05Degrees(): DateTime | null {
+ public getBainHashmashosYereim3Point05Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_MINUS_3_POINT_05);
}
@@ -2447,7 +2449,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim3Point05Degrees(): DateTime | null {
+ public getBainHasmashosYereim3Point05Degrees(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim3Point05Degrees();
}
@@ -2466,7 +2468,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getBainHashmashosYereim2Point8Degrees()
*/
- public getBainHashmashosYereim16Point875Minutes(): DateTime | null {
+ public getBainHashmashosYereim16Point875Minutes(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), -16.875 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2475,7 +2477,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim16Point875Minutes(): DateTime | null {
+ public getBainHasmashosYereim16Point875Minutes(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim16Point875Minutes();
}
@@ -2500,7 +2502,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getBainHashmashosYereim3Point05Degrees()
* @see #getBainHashmashosYereim2Point1Degrees()
*/
- public getBainHashmashosYereim2Point8Degrees(): DateTime | null {
+ public getBainHashmashosYereim2Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_MINUS_2_POINT_8);
}
@@ -2509,7 +2511,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim2Point8Degrees(): DateTime | null {
+ public getBainHasmashosYereim2Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim2Point8Degrees();
}
@@ -2527,7 +2529,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getBainHashmashosYereim2Point1Degrees()
*/
- public getBainHashmashosYereim13Point5Minutes(): DateTime | null {
+ public getBainHashmashosYereim13Point5Minutes(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), -13.5 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2536,7 +2538,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim13Point5Minutes(): DateTime | null {
+ public getBainHasmashosYereim13Point5Minutes(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim13Point5Minutes();
}
@@ -2561,7 +2563,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getBainHashmashosYereim2Point8Degrees()
* @see #getBainHashmashosYereim3Point05Degrees()
*/
- public getBainHashmashosYereim2Point1Degrees(): DateTime | null {
+ public getBainHashmashosYereim2Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_MINUS_2_POINT_1);
}
@@ -2570,7 +2572,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the properly spelled version.
* @deprecated
*/
- public getBainHasmashosYereim2Point1Degrees(): DateTime | null {
+ public getBainHasmashosYereim2Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getBainHashmashosYereim2Point1Degrees();
}
@@ -2581,7 +2583,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the Date representing the time when the sun is 3.7° below sea level.
* @see #ZENITH_3_POINT_7
*/
- public getTzaisGeonim3Point7Degrees(): DateTime | null {
+ public getTzaisGeonim3Point7Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_3_POINT_7);
}
@@ -2592,7 +2594,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the Date representing the time when the sun is 3.8° below sea level.
* @see #ZENITH_3_POINT_8
*/
- public getTzaisGeonim3Point8Degrees(): DateTime | null {
+ public getTzaisGeonim3Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_3_POINT_8);
}
@@ -2607,7 +2609,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_5_POINT_95
*/
- public getTzaisGeonim5Point95Degrees(): DateTime | null {
+ public getTzaisGeonim5Point95Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_5_POINT_95);
}
@@ -2627,7 +2629,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* equinox / equilux in Jerusalem.
* @see #ZENITH_3_POINT_65
*/
- public getTzaisGeonim3Point65Degrees(): DateTime | null {
+ public getTzaisGeonim3Point65Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_3_POINT_65);
}
@@ -2648,7 +2650,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* equinox / equilux in Jerusalem.
* @see #ZENITH_3_POINT_676
*/
- public getTzaisGeonim3Point676Degrees(): DateTime | null {
+ public getTzaisGeonim3Point676Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_3_POINT_676);
}
@@ -2665,7 +2667,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_4_POINT_61
*/
- public getTzaisGeonim4Point61Degrees(): DateTime | null {
+ public getTzaisGeonim4Point61Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_4_POINT_61);
}
@@ -2682,7 +2684,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_4_POINT_37
*/
- public getTzaisGeonim4Point37Degrees(): DateTime | null {
+ public getTzaisGeonim4Point37Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_4_POINT_37);
}
@@ -2701,7 +2703,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_5_POINT_88
*/
- public getTzaisGeonim5Point88Degrees(): DateTime | null {
+ public getTzaisGeonim5Point88Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_5_POINT_88);
}
@@ -2719,7 +2721,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_4_POINT_8
*/
- public getTzaisGeonim4Point8Degrees(): DateTime | null {
+ public getTzaisGeonim4Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_4_POINT_8);
}
@@ -2739,7 +2741,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #ZENITH_6_POINT_45
*/
- public getTzaisGeonim6Point45Degrees(): DateTime | null {
+ public getTzaisGeonim6Point45Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_6_POINT_45);
}
@@ -2768,7 +2770,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #ZENITH_7_POINT_083
*/
- public getTzaisGeonim7Point083Degrees(): DateTime | null {
+ public getTzaisGeonim7Point083Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_7_POINT_083);
}
@@ -2797,7 +2799,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* {@link AstronomicalCalendar} documentation.
* @see #ZENITH_7_POINT_67
*/
- public getTzaisGeonim7Point67Degrees(): DateTime | null {
+ public getTzaisGeonim7Point67Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_7_POINT_67);
}
@@ -2812,7 +2814,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #ZENITH_8_POINT_5
*/
- public getTzaisGeonim8Point5Degrees(): DateTime | null {
+ public getTzaisGeonim8Point5Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_8_POINT_5);
}
@@ -2827,7 +2829,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* null will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- public getTzaisGeonim9Point3Degrees(): DateTime | null {
+ public getTzaisGeonim9Point3Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_9_POINT_3);
}
@@ -2850,7 +2852,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see #getTzais60()
*/
- public getTzaisGeonim9Point75Degrees(): DateTime | null {
+ public getTzaisGeonim9Point75Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_9_POINT_75);
}
@@ -2872,7 +2874,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getPlagHamincha60Minutes()
* @see #getShaahZmanis60Minutes()
*/
- public getTzais60(): DateTime | null {
+ public getTzais60(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 60 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2892,7 +2894,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAteretTorahSunsetOffset()
* @see #setAteretTorahSunsetOffset(double)
*/
- public getTzaisAteretTorah(): DateTime | null {
+ public getTzaisAteretTorah(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), this.getAteretTorahSunsetOffset() * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -2943,7 +2945,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #setAteretTorahSunsetOffset(double)
* @see #getShaahZmanisAteretTorah()
*/
- public getSofZmanShmaAteretTorah(): DateTime | null {
+ public getSofZmanShmaAteretTorah(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos72Zmanis(), this.getTzaisAteretTorah());
}
@@ -2966,7 +2968,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanisAteretTorah()
* @see #setAteretTorahSunsetOffset(double)
*/
- public getSofZmanTfilaAteretTorah(): DateTime | null {
+ public getSofZmanTfilaAteretTorah(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos72Zmanis(), this.getTzaisAteretTorah());
}
@@ -2978,7 +2980,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* the sun does not rise, and one where it does not set, a null will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanTfilahAteretTorah(): DateTime | null {
+ public getSofZmanTfilahAteretTorah(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfilaAteretTorah();
}
@@ -3006,7 +3008,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaGedolaAteretTorah(): DateTime | null {
+ public getMinchaGedolaAteretTorah(): Temporal.ZonedDateTime | null {
return this.getMinchaGedola(this.getAlos72Zmanis(), this.getTzaisAteretTorah());
}
@@ -3033,7 +3035,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaKetanaAteretTorah(): DateTime | null {
+ public getMinchaKetanaAteretTorah(): Temporal.ZonedDateTime | null {
return this.getMinchaKetana(this.getAlos72Zmanis(), this.getTzaisAteretTorah());
}
@@ -3055,7 +3057,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #setAteretTorahSunsetOffset(double)
* @see #getAteretTorahSunsetOffset()
*/
- public getPlagHaminchaAteretTorah(): DateTime | null {
+ public getPlagHaminchaAteretTorah(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getAlos72Zmanis(), this.getTzaisAteretTorah());
}
@@ -3075,7 +3077,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getAlos72Zmanis()
*/
- public getTzais72Zmanis(): DateTime | null {
+ public getTzais72Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(1.2);
}
@@ -3092,7 +3094,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* tell if it is sunrise or sunset based. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- private getZmanisBasedOffset(hours: number): DateTime | null {
+ private getZmanisBasedOffset(hours: number): Temporal.ZonedDateTime | null {
const shaahZmanis: number = this.getShaahZmanisGra();
if (shaahZmanis === Long_MIN_VALUE || hours === 0) {
return null;
@@ -3114,7 +3116,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getAlos90Zmanis()
*/
- public getTzais90Zmanis(): DateTime | null {
+ public getTzais90Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(1.5);
}
@@ -3128,7 +3130,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getAlos96Zmanis()
*/
- public getTzais96Zmanis(): DateTime | null {
+ public getTzais96Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(1.6);
}
@@ -3148,7 +3150,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais19Point8Degrees()
* @see #getAlos90()
*/
- public getTzais90(): DateTime | null {
+ public getTzais90(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 90 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -3174,7 +3176,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais26Degrees()
* @see #getAlos120()
*/
- public getTzais120(): DateTime | null {
+ public getTzais120(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 120 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -3197,7 +3199,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais120()
* @see #getTzais26Degrees()
*/
- public getTzais120Zmanis(): DateTime | null {
+ public getTzais120Zmanis(): Temporal.ZonedDateTime | null {
return this.getZmanisBasedOffset(2);
}
@@ -3221,7 +3223,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais72()
* @see #getAlos16Point1Degrees() for more information on this calculation.
*/
- public getTzais16Point1Degrees(): DateTime | null {
+ public getTzais16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_16_POINT_1);
}
@@ -3243,7 +3245,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais120()
* @see #getAlos26Degrees()
*/
- public getTzais26Degrees(): DateTime | null {
+ public getTzais26Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_26_DEGREES);
}
@@ -3256,7 +3258,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #getAlos18Degrees()
*/
- public getTzais18Degrees(): DateTime | null {
+ public getTzais18Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ASTRONOMICAL_ZENITH);
}
@@ -3270,7 +3272,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTzais90()
* @see #getAlos19Point8Degrees()
*/
- public getTzais19Point8Degrees(): DateTime | null {
+ public getTzais19Point8Degrees(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_19_POINT_8);
}
@@ -3284,7 +3286,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* documentation.
* @see #getAlos96()
*/
- public getTzais96(): DateTime | null {
+ public getTzais96(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 96 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -3306,7 +3308,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the Date representing the local chatzos
* @see GeoLocation#getLocalMeanTimeOffset()
*/
- public getFixedLocalChatzos(): DateTime | null {
+ public getFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getLocalMeanTime(12);
}
@@ -3336,7 +3338,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* #getSofZmanShma3HoursBeforeChatzos()} should be used to calculate sof zman Tfila using 3 fixed
* clock hours. This will likely be removed in a future version.
*/
- public getSofZmanShmaFixedLocal(): DateTime | null {
+ public getSofZmanShmaFixedLocal(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getFixedLocalChatzos(), -180 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -3362,7 +3364,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* #getSofZmanTfila2HoursBeforeChatzos()} should be used to calculate sof zman Tfila using using 2 fixed
* clock hours. This will likely be removed in a future version.
*/
- public getSofZmanTfilaFixedLocal(): DateTime | null {
+ public getSofZmanTfilaFixedLocal(): Temporal.ZonedDateTime | null {
return ComplexZmanimCalendar.getTimeOffset(this.getFixedLocalChatzos(), -120 * ComplexZmanimCalendar.MINUTE_MILLIS);
}
@@ -3386,13 +3388,14 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @return the molad based time. If the zman does not occur during the current date, null will be
* returned.
*/
- private getMoladBasedTime(moladBasedTime: DateTime, alos: DateTime | null, tzais: DateTime | null, techila: boolean): DateTime | null {
- const lastMidnight: DateTime = this.getMidnightLastNight();
- const midnightTonight: DateTime = this.getMidnightTonight();
+ private getMoladBasedTime(moladBasedTime: Temporal.ZonedDateTime, alos: Temporal.ZonedDateTime | null, tzais: Temporal.ZonedDateTime | null, techila: boolean): Temporal.ZonedDateTime | null {
+ const lastMidnight: Temporal.ZonedDateTime = this.getMidnightLastNight();
+ const midnightTonight: Temporal.ZonedDateTime = this.getMidnightTonight();
- if (!((moladBasedTime < lastMidnight) || (moladBasedTime > midnightTonight))) {
+ if (!((Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0)
+ || (Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0))) {
if (alos !== null || tzais !== null) {
- return techila && !(moladBasedTime < tzais! || moladBasedTime > alos!)
+ return techila && !(Temporal.ZonedDateTime.compare(moladBasedTime, tzais!) < 0 || Temporal.ZonedDateTime.compare(moladBasedTime, alos!) > 0)
? tzais
: alos;
}
@@ -3424,7 +3427,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getSofZmanKidushLevana15Days()
* @see JewishCalendar#getSofZmanKidushLevanaBetweenMoldos()
*/
- public getSofZmanKidushLevanaBetweenMoldos(alos: DateTime | null = null, tzais: DateTime | null = null): DateTime | null {
+ public getSofZmanKidushLevanaBetweenMoldos(alos: Temporal.ZonedDateTime | null = null, tzais: Temporal.ZonedDateTime | null = null): Temporal.ZonedDateTime | null {
const jewishCalendar: JewishCalendar = new JewishCalendar(this.getDate());
// Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French
@@ -3481,7 +3484,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see JewishCalendar#getSofZmanKidushLevana15Days()
*
*/
- public getSofZmanKidushLevana15Days(alos: DateTime | null = null, tzais: DateTime | null = null): DateTime | null {
+ public getSofZmanKidushLevana15Days(alos: Temporal.ZonedDateTime | null = null, tzais: Temporal.ZonedDateTime | null = null): Temporal.ZonedDateTime | null {
const jewishCalendar: JewishCalendar = new JewishCalendar(this.getDate());
// Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in
@@ -3542,7 +3545,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTchilasZmanKidushLevana7Days(Date, Date)
* @see JewishCalendar#getTchilasZmanKidushLevana3Days()
*/
- public getTchilasZmanKidushLevana3Days(alos: DateTime | null = null, tzais: DateTime | null = null): DateTime | null {
+ public getTchilasZmanKidushLevana3Days(alos: Temporal.ZonedDateTime | null = null, tzais: Temporal.ZonedDateTime | null = null): Temporal.ZonedDateTime | null {
const jewishCalendar: JewishCalendar = new JewishCalendar();
jewishCalendar.setGregorianDate(this.getDate().year, this.getDate().month - 1, this.getDate().day);
@@ -3555,7 +3558,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
return null;
}
- let zman: DateTime | null = this.getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), alos, tzais, true);
+ let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(jewishCalendar.getTchilasZmanKidushLevana3Days(), alos, tzais, true);
// Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when
// kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)
@@ -3608,7 +3611,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getTchilasZmanKidushLevana7Days(Date, Date)
* @see JewishCalendar#getMoladAsDate()
*/
- public getZmanMolad(): DateTime | null {
+ public getZmanMolad(): Temporal.ZonedDateTime | null {
const jewishCalendar: JewishCalendar = new JewishCalendar();
jewishCalendar.setGregorianDate(this.getDate().year, this.getDate().month - 1, this.getDate().day);
@@ -3619,7 +3622,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
return null;
}
- let molad: DateTime | null = this.getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
+ let molad: Temporal.ZonedDateTime | null = this.getMoladBasedTime(jewishCalendar.getMoladAsDate(), null, null, true);
// deal with molad that happens on the end of the previous month
if (molad === null && jewishCalendar.getJewishDayOfMonth() > 26) {
@@ -3634,13 +3637,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMoladBasedTime(Date, Date, Date, boolean)
* @return previous midnight
*/
- private getMidnightLastNight(): DateTime {
+ private getMidnightLastNight(): Temporal.ZonedDateTime {
// reset hour, minutes, seconds and millis
- return this.getDate().set({
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0,
+ return this.getDate().toZonedDateTime({
+ timeZone: this.getGeoLocation().getTimeZone(),
});
}
@@ -3649,15 +3649,12 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMoladBasedTime(Date, Date, Date, boolean)
* @return following midnight
*/
- private getMidnightTonight(): DateTime {
+ private getMidnightTonight(): Temporal.ZonedDateTime {
return this.getDate()
- .plus({ days: 1 })
- .set({
- hour: 0,
- minute: 0,
- second: 0,
- millisecond: 0,
- });
+ .add({ days: 1 })
+ .toZonedDateTime({
+ timeZone: this.getGeoLocation().getTimeZone(),
+ });
}
/**
@@ -3671,7 +3668,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see JewishCalendar#getTchilasZmanKidushLevana7Days()
* @see #getTchilasZmanKidushLevana3Days()
*/
- public getTchilasZmanKidushLevana7Days(alos: DateTime | null = null, tzais: DateTime | null = null): DateTime | null {
+ public getTchilasZmanKidushLevana7Days(alos: Temporal.ZonedDateTime | null = null, tzais: Temporal.ZonedDateTime | null = null): Temporal.ZonedDateTime | null {
const jewishCalendar: JewishCalendar = new JewishCalendar(this.getDate());
// Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for
@@ -3721,10 +3718,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
* @todo enable the calendar check for erev pesach and return null in all other cases.
*/
- public getSofZmanAchilasChametzGRA(): DateTime | null {
+ public getSofZmanAchilasChametzGRA(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return this.getSofZmanTfilaGRA();
@@ -3754,10 +3751,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos72()
* @see #getSofZmanTfilaMGA72Minutes()
*/
- public getSofZmanAchilasChametzMGA72Minutes(): DateTime | null {
+ public getSofZmanAchilasChametzMGA72Minutes(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return this.getSofZmanTfilaMGA72Minutes();
@@ -3787,7 +3784,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos72Zmanis()
* @see #getSofZmanTfilaMGA72MinutesZmanis()
*/
- public getSofZmanAchilasChametzMGA72MinutesZmanis(): DateTime | null {
+ public getSofZmanAchilasChametzMGA72MinutesZmanis(): Temporal.ZonedDateTime | null {
const jewishCalendar = new JewishCalendar();
jewishCalendar.setGregorianDate(this.getDate().year, this.getDate().month - 1, this.getDate().day);
@@ -3816,10 +3813,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getAlos16Point1Degrees()
* @see #getSofZmanTfilaMGA16Point1Degrees()
*/
- public getSofZmanAchilasChametzMGA16Point1Degrees(): DateTime | null {
+ public getSofZmanAchilasChametzMGA16Point1Degrees(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return this.getSofZmanTfilaMGA16Point1Degrees();
@@ -3844,10 +3841,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* one day a year where the sun does not rise, and one where it does not set, a null will be
* returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanBiurChametzGRA(): DateTime | null {
+ public getSofZmanBiurChametzGRA(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return ComplexZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), this.getShaahZmanisGra() * 5);
@@ -3875,10 +3872,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanisMGA()
* @see #getAlos72()
*/
- public getSofZmanBiurChametzMGA72Minutes(): DateTime | null {
+ public getSofZmanBiurChametzMGA72Minutes(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return ComplexZmanimCalendar.getTimeOffset(this.getAlos72(), this.getShaahZmanisMGA() * 5);
@@ -3906,7 +3903,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis72MinutesZmanis()
* @see #getAlos72Zmanis()
*/
- public getSofZmanBiurChametzMGA72MinutesZmanis(): DateTime | null {
+ public getSofZmanBiurChametzMGA72MinutesZmanis(): Temporal.ZonedDateTime | null {
const jewishCalendar = new JewishCalendar();
jewishCalendar.setGregorianDate(this.getDate().year, this.getDate().month - 1, this.getDate().day);
@@ -3936,10 +3933,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getShaahZmanis16Point1Degrees()
* @see #getAlos16Point1Degrees()
*/
- public getSofZmanBiurChametzMGA16Point1Degrees(): DateTime | null {
+ public getSofZmanBiurChametzMGA16Point1Degrees(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return ComplexZmanimCalendar.getTimeOffset(this.getAlos16Point1Degrees(), this.getShaahZmanis16Point1Degrees() * 5);
@@ -3984,7 +3981,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getSunsetBaalHatanya()
* @see #ZENITH_1_POINT_583
*/
- private getSunriseBaalHatanya(): DateTime | null {
+ private getSunriseBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_1_POINT_583);
}
@@ -4015,7 +4012,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getSunriseBaalHatanya()
* @see #ZENITH_1_POINT_583
*/
- private getSunsetBaalHatanya(): DateTime | null {
+ private getSunsetBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_1_POINT_583);
}
@@ -4060,7 +4057,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* low enough below the horizon for this calculation, a null will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getAlosBaalHatanya(): DateTime | null {
+ public getAlosBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ComplexZmanimCalendar.ZENITH_16_POINT_9);
}
@@ -4078,7 +4075,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* not rise, and one where it does not set, a null will be returned. See detailed explanation on
* top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanShmaBaalHatanya(): DateTime | null {
+ public getSofZmanShmaBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), true);
}
@@ -4095,7 +4092,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanTfilaBaalHatanya(): DateTime | null {
+ public getSofZmanTfilaBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), true);
}
@@ -4113,10 +4110,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* day a year where the sun does not rise, and one where it does not set, a null will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanAchilasChametzBaalHatanya(): DateTime | null {
+ public getSofZmanAchilasChametzBaalHatanya(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return this.getSofZmanTfilaBaalHatanya();
@@ -4139,10 +4136,10 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* least one day a year where the sun does not rise, and one where it does not set, a null will be
* returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanBiurChametzBaalHatanya(): DateTime | null {
+ public getSofZmanBiurChametzBaalHatanya(): Temporal.ZonedDateTime | null {
/*
const jewishCalendar: JewishCalendar = new JewishCalendar();
- const now: DateTime = DateTime.local();
+ const now: Temporal.ZonedDateTime = Temporal.Now.zonedDateTimeISO();
jewishCalendar.setGregorianDate(now.year, now.month, now.day);
if (jewishCalendar.getJewishMonth() === JewishCalendar.NISSAN && jewishCalendar.getJewishDayOfMonth() === 14) {
return ComplexZmanimCalendar.getTimeOffset(this.getSunriseBaalHatanya(), this.getShaahZmanisBaalHatanya() * 5);
@@ -4175,7 +4172,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* and one where it does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaGedolaBaalHatanya(): DateTime | null {
+ public getMinchaGedolaBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getMinchaGedola(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), true);
}
@@ -4193,12 +4190,12 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* where the sun does not rise, and one where it does not set, a null will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getMinchaGedolaBaalHatanyaGreaterThan30(): DateTime | null {
+ public getMinchaGedolaBaalHatanyaGreaterThan30(): Temporal.ZonedDateTime | null {
if (this.getMinchaGedola30Minutes() === null || this.getMinchaGedolaBaalHatanya() === null) {
return null;
}
- return DateTime.max(this.getMinchaGedola30Minutes()!, this.getMinchaGedolaBaalHatanya()!);
+ return zdtMax(this.getMinchaGedola30Minutes()!, this.getMinchaGedolaBaalHatanya()!);
}
/**
@@ -4218,7 +4215,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getMinchaKetanaBaalHatanya(): DateTime | null {
+ public getMinchaKetanaBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getMinchaKetana(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), true);
}
@@ -4234,7 +4231,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getPlagHaminchaBaalHatanya(): DateTime | null {
+ public getPlagHaminchaBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getPlagHamincha(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), true);
}
@@ -4249,7 +4246,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* explanation on top of the {@link AstronomicalCalendar} documentation.
* @see #ZENITH_6_DEGREES
*/
- public getTzaisBaalHatanya(): DateTime | null {
+ public getTzaisBaalHatanya(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ComplexZmanimCalendar.ZENITH_6_DEGREES);
}
@@ -4279,7 +4276,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
*
* @see ComplexZmanimCalendar#getFixedLocalChatzos()
*/
- public getFixedLocalChatzosBasedZmanim(startOfHalfDay: DateTime | null, endOfHalfDay: DateTime | null, hours: number): DateTime | null {
+ public getFixedLocalChatzosBasedZmanim(startOfHalfDay: Temporal.ZonedDateTime | null, endOfHalfDay: Temporal.ZonedDateTime | null, hours: number): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(startOfHalfDay, endOfHalfDay, hours);
}
@@ -4299,7 +4296,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanShmaMGA18DegreesToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanShmaMGA18DegreesToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getAlos18Degrees(), this.getFixedLocalChatzos(), 3);
}
@@ -4319,7 +4316,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getAlos16Point1Degrees(), this.getFixedLocalChatzos(), 3);
}
@@ -4340,7 +4337,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanShmaMGA90MinutesToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanShmaMGA90MinutesToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getAlos90(), this.getFixedLocalChatzos(), 3);
}
@@ -4361,7 +4358,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanShmaMGA72MinutesToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanShmaMGA72MinutesToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getAlos72(), this.getFixedLocalChatzos(), 3);
}
@@ -4381,7 +4378,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanShmaGRASunriseToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanShmaGRASunriseToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getElevationAdjustedSunrise(), this.getFixedLocalChatzos(), 3);
}
@@ -4401,7 +4398,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getHalfDayBasedZman(Date, Date, double)
*/
- public getSofZmanTfilaGRASunriseToFixedLocalChatzos(): DateTime | null {
+ public getSofZmanTfilaGRASunriseToFixedLocalChatzos(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getElevationAdjustedSunrise(), this.getFixedLocalChatzos(), 4);
}
@@ -4420,7 +4417,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getFixedLocalChatzos()
* @see #getMinchaKetanaGRAFixedLocalChatzosToSunset
*/
- public getMinchaGedolaGRAFixedLocalChatzos30Minutes(): DateTime | null {
+ public getMinchaGedolaGRAFixedLocalChatzos30Minutes(): Temporal.ZonedDateTime | null {
return ZmanimCalendar.getTimeOffset(this.getFixedLocalChatzos(), ZmanimCalendar.MINUTE_MILLIS * 30);
}
@@ -4441,7 +4438,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
* @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
*/
- public getMinchaKetanaGRAFixedLocalChatzosToSunset(): DateTime | null {
+ public getMinchaKetanaGRAFixedLocalChatzosToSunset(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getFixedLocalChatzos(), this.getElevationAdjustedSunset(), 3.5);
}
@@ -4462,7 +4459,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* @see #getMinchaGedolaGRAFixedLocalChatzos30Minutes
* @see ZmanimCalendar#getHalfDayBasedZman(Date, Date, double)
*/
- public getPlagHaminchaGRAFixedLocalChatzosToSunset(): DateTime | null {
+ public getPlagHaminchaGRAFixedLocalChatzosToSunset(): Temporal.ZonedDateTime | null {
return this.getHalfDayBasedZman(this.getFixedLocalChatzos(), this.getElevationAdjustedSunset(), 4.75);
}
@@ -4476,7 +4473,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* a null will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- public getTzais50(): DateTime | null {
+ public getTzais50(): Temporal.ZonedDateTime | null {
return ZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 50 * ZmanimCalendar.MINUTE_MILLIS);
}
@@ -4498,7 +4495,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* where the sun may not reach low enough below the horizon for this calculation, a null will be
* returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSamuchLeMinchaKetanaGRA(): DateTime | null {
+ public getSamuchLeMinchaKetanaGRA(): Temporal.ZonedDateTime | null {
return this.getSamuchLeMinchaKetana(this.getElevationAdjustedSunrise(), this.getElevationAdjustedSunset(), true);
}
@@ -4517,7 +4514,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* where the sun may not reach low enough below the horizon for this calculation, a null will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSamuchLeMinchaKetana16Point1Degrees(): DateTime | null {
+ public getSamuchLeMinchaKetana16Point1Degrees(): Temporal.ZonedDateTime | null {
return this.getSamuchLeMinchaKetana(this.getAlos16Point1Degrees(), this.getTzais16Point1Degrees(), true);
}
@@ -4535,7 +4532,7 @@ export class ComplexZmanimCalendar extends ZmanimCalendar {
* where the sun may not reach low enough below the horizon for this calculation, a null will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSamuchLeMinchaKetana72Minutes(): DateTime | null {
+ public getSamuchLeMinchaKetana72Minutes(): Temporal.ZonedDateTime | null {
return this.getSamuchLeMinchaKetana(this.getAlos72(), this.getTzais72(), true);
}
diff --git a/src/ZmanimCalendar.ts b/src/ZmanimCalendar.ts
index 0ed3605..a54e05a 100644
--- a/src/ZmanimCalendar.ts
+++ b/src/ZmanimCalendar.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { AstronomicalCalendar } from './AstronomicalCalendar';
import { JewishCalendar } from './hebrewcalendar/JewishCalendar';
@@ -249,7 +249,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* {@link AstronomicalCalendar#getSunrise()} if it is true.
* @see com.kosherjava.zmanim.AstronomicalCalendar#getSunrise()
*/
- protected getElevationAdjustedSunrise(): DateTime | null {
+ protected getElevationAdjustedSunrise(): Temporal.ZonedDateTime | null {
if (this.isUseElevation()) {
return super.getSunrise();
}
@@ -265,7 +265,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* {@link AstronomicalCalendar#getSunset()} if it is true.
* @see AstronomicalCalendar#getSunset()
*/
- protected getElevationAdjustedSunset(): DateTime | null {
+ protected getElevationAdjustedSunset(): Temporal.ZonedDateTime | null {
if (this.isUseElevation()) {
return super.getSunset();
}
@@ -287,7 +287,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see #ZENITH_8_POINT_5
* ComplexZmanimCalendar#getTzaisGeonim8Point5Degrees() that returns an identical time to this generic tzais
*/
- public getTzais(): DateTime | null {
+ public getTzais(): Temporal.ZonedDateTime | null {
return this.getSunsetOffsetByDegrees(ZmanimCalendar.ZENITH_8_POINT_5);
}
@@ -309,7 +309,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* low enough below the horizon for this calculation, a null will be returned. See detailed
* explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getAlosHashachar(): DateTime | null {
+ public getAlosHashachar(): Temporal.ZonedDateTime | null {
return this.getSunriseOffsetByDegrees(ZmanimCalendar.ZENITH_16_POINT_1);
}
@@ -327,7 +327,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* a null will be returned. See detailed explanation on top of the {@link AstronomicalCalendar}
* documentation.
*/
- public getAlos72(): DateTime | null {
+ public getAlos72(): Temporal.ZonedDateTime | null {
return ZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunrise(), -72 * ZmanimCalendar.MINUTE_MILLIS);
}
@@ -355,12 +355,12 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* support astronomical calculations (that will never report a null) a null will be returned.
* See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getChatzos(): DateTime | null {
+ public getChatzos(): Temporal.ZonedDateTime | null {
if (this.useAstronomicalChatzos) {
return this.getSunTransit(); // can be null of the calculator does not support astronomical chatzos
}
- const halfDayChatzos: DateTime | null = this.getChatzosAsHalfDay();
+ const halfDayChatzos: Temporal.ZonedDateTime | null = this.getChatzosAsHalfDay();
return halfDayChatzos === null
? this.getSunTransit() // can be null if the calculator does not support astronomical chatzos
: halfDayChatzos;
@@ -395,7 +395,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* it does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getChatzosAsHalfDay(): DateTime | null {
+ public getChatzosAsHalfDay(): Temporal.ZonedDateTime | null {
return this.getSunTransit(this.getSeaLevelSunrise(), this.getSeaLevelSunset());
}
@@ -430,7 +430,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* a year where the sun does not rise, and one where it does not set, a null will be returned. See
* detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanShma(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getSofZmanShma(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (this.isUseAstronomicalChatzosForOtherZmanim() && synchronous) {
return this.getHalfDayBasedZman(startOfDay, this.getChatzos(), 3);
}
@@ -478,7 +478,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* and one where it does not set, a null will be returned. See the detailed explanation on top
* of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanShmaGRA(): DateTime | null {
+ public getSofZmanShmaGRA(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getElevationAdjustedSunrise(), this.getElevationAdjustedSunset(), true);
}
@@ -499,7 +499,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see ComplexZmanimCalendar#getAlos72()
* @see ComplexZmanimCalendar#getSofZmanShmaMGA72Minutes()
*/
- public getSofZmanShmaMGA(): DateTime | null {
+ public getSofZmanShmaMGA(): Temporal.ZonedDateTime | null {
return this.getSofZmanShma(this.getAlos72(), this.getTzais72(), true);
}
@@ -519,7 +519,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* and one where it does not set, a null will be returned See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getTzais72(): DateTime | null {
+ public getTzais72(): Temporal.ZonedDateTime | null {
return ZmanimCalendar.getTimeOffset(this.getElevationAdjustedSunset(), 72 * ZmanimCalendar.MINUTE_MILLIS);
}
@@ -538,7 +538,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see #getCandleLightingOffset()
* @see #setCandleLightingOffset(double)
*/
- public getCandleLighting(): DateTime | null {
+ public getCandleLighting(): Temporal.ZonedDateTime | null {
return ZmanimCalendar.getTimeOffset(this.getSeaLevelSunset(), -this.getCandleLightingOffset() * ZmanimCalendar.MINUTE_MILLIS);
}
@@ -574,7 +574,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* one day a year where the sun does not rise, and one where it does not set, a null will be
* returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanTfila(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getSofZmanTfila(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (this.isUseAstronomicalChatzosForOtherZmanim() && synchronous) {
return this.getHalfDayBasedZman(startOfDay, this.getChatzos(), 4);
}
@@ -621,7 +621,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getSofZmanTfilaGRA(): DateTime | null {
+ public getSofZmanTfilaGRA(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getElevationAdjustedSunrise(), this.getElevationAdjustedSunset(), true);
}
@@ -641,7 +641,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see #getShaahZmanisMGA()
* @see #getAlos72()
*/
- public getSofZmanTfilaMGA(): DateTime | null {
+ public getSofZmanTfilaMGA(): Temporal.ZonedDateTime | null {
return this.getSofZmanTfila(this.getAlos72(), this.getTzais72(), true);
}
@@ -685,9 +685,9 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see #isUseAstronomicalChatzos()
* @see #isUseAstronomicalChatzosForOtherZmanim()
*/
- public getMinchaGedola(): DateTime | null;
- public getMinchaGedola(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null;
- public getMinchaGedola(startOfDay?: DateTime | null, endOfDay?: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getMinchaGedola(): Temporal.ZonedDateTime | null;
+ public getMinchaGedola(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null;
+ public getMinchaGedola(startOfDay?: Temporal.ZonedDateTime | null, endOfDay?: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (startOfDay === undefined && endOfDay === undefined) {
// eslint-disable-next-line no-param-reassign
startOfDay = this.getElevationAdjustedSunrise();
@@ -698,10 +698,10 @@ export class ZmanimCalendar extends AstronomicalCalendar {
}
if (this.isUseAstronomicalChatzosForOtherZmanim() && synchronous) {
- return this.getHalfDayBasedZman(this.getChatzos(), endOfDay as DateTime | null, 0.5);
+ return this.getHalfDayBasedZman(this.getChatzos(), endOfDay as Temporal.ZonedDateTime | null, 0.5);
}
- return this.getShaahZmanisBasedZman(startOfDay as DateTime | null, endOfDay as DateTime | null, 6.5);
+ return this.getShaahZmanisBasedZman(startOfDay as Temporal.ZonedDateTime | null, endOfDay as Temporal.ZonedDateTime | null, 6.5);
}
/**
@@ -790,7 +790,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see ComplexZmanimCalendar#getSamuchLeMinchaKetana16Point1Degrees()
* @see ComplexZmanimCalendar#getSamuchLeMinchaKetana72Minutes()
*/
- public getSamuchLeMinchaKetana(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getSamuchLeMinchaKetana(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (this.isUseAstronomicalChatzosForOtherZmanim() && synchronous) {
return this.getHalfDayBasedZman(this.getChatzos(), endOfDay, 3);
}
@@ -853,7 +853,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* at least one day a year where the sun does not rise, and one where it does not set, a null will
* be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getMinchaKetana(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getMinchaKetana(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (startOfDay === undefined && endOfDay === undefined) {
// eslint-disable-next-line no-param-reassign
startOfDay = this.getElevationAdjustedSunrise();
@@ -949,7 +949,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* at least one day a year where the sun does not rise, and one where it does not set, a null
* will be returned. See detailed explanation on top of the {@link AstronomicalCalendar} documentation.
*/
- public getPlagHamincha(startOfDay: DateTime | null, endOfDay: DateTime | null, synchronous?: boolean): DateTime | null {
+ public getPlagHamincha(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null, synchronous?: boolean): Temporal.ZonedDateTime | null {
if (startOfDay === undefined && endOfDay === undefined) {
// eslint-disable-next-line no-param-reassign
startOfDay = this.getElevationAdjustedSunrise();
@@ -1124,7 +1124,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see JewishCalendar#hasCandleLighting()
* @see JewishCalendar#setInIsrael(boolean)
*/
- public isAssurBemlacha(currentTime: DateTime, tzais: DateTime, inIsrael: boolean): boolean {
+ public isAssurBemlacha(currentTime: Temporal.ZonedDateTime, tzais: Temporal.ZonedDateTime, inIsrael: boolean): boolean {
const jewishCalendar: JewishCalendar = new JewishCalendar();
const date = this.getDate();
jewishCalendar.setGregorianDate(date.year, date.month - 1, date.day);
@@ -1133,12 +1133,13 @@ export class ZmanimCalendar extends AstronomicalCalendar {
// erev shabbos, YT or YT sheni and after shkiah
const sunset = this.getElevationAdjustedSunset();
if (!sunset) throw new NullPointerException();
- if (jewishCalendar.hasCandleLighting() && currentTime >= sunset) {
+ if (jewishCalendar.hasCandleLighting() && Temporal.ZonedDateTime.compare(currentTime, sunset) >= 0) {
return true;
}
// is shabbos or YT and it is before tzais
- return jewishCalendar.isAssurBemelacha() && currentTime <= tzais;
+ return jewishCalendar.isAssurBemelacha()
+ && Temporal.ZonedDateTime.compare(currentTime, tzais) <= 0;
}
/**
@@ -1164,8 +1165,8 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* where it does not set, a null will be returned. See detailed explanation on top of the
* {@link AstronomicalCalendar} documentation.
*/
- public getShaahZmanisBasedZman(startOfDay: DateTime | null, endOfDay: DateTime | null,
- hours: number): DateTime | null {
+ public getShaahZmanisBasedZman(startOfDay: Temporal.ZonedDateTime | null, endOfDay: Temporal.ZonedDateTime | null,
+ hours: number): Temporal.ZonedDateTime | null {
const shaahZmanis: number = this.getTemporalHour(startOfDay, endOfDay);
return ZmanimCalendar.getTimeOffset(startOfDay, shaahZmanis * hours);
}
@@ -1189,10 +1190,10 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* explanation on top of the page.
*/
public getPercentOfShaahZmanisFromDegrees(degrees: number, sunset: boolean): number {
- const seaLevelSunrise: DateTime | null = this.getSeaLevelSunrise();
- const seaLevelSunset: DateTime | null = this.getSeaLevelSunset();
+ const seaLevelSunrise: Temporal.ZonedDateTime | null = this.getSeaLevelSunrise();
+ const seaLevelSunset: Temporal.ZonedDateTime | null = this.getSeaLevelSunset();
- let twilight: DateTime | null = null;
+ let twilight: Temporal.ZonedDateTime | null = null;
if (sunset) {
twilight = this.getSunsetOffsetByDegrees(ZmanimCalendar.GEOMETRIC_ZENITH + degrees);
} else {
@@ -1203,13 +1204,13 @@ export class ZmanimCalendar extends AstronomicalCalendar {
return Double_MIN_VALUE;
}
- const shaahZmanis: number = (seaLevelSunset!.valueOf() - seaLevelSunrise!.valueOf()) / 12.0;
+ const shaahZmanis: number = (seaLevelSunset!.epochMilliseconds - seaLevelSunrise!.epochMilliseconds) / 12.0;
let riseSetToTwilight: number;
if (sunset) {
- riseSetToTwilight = twilight!.valueOf() - seaLevelSunset!.valueOf();
+ riseSetToTwilight = twilight!.epochMilliseconds - seaLevelSunset!.epochMilliseconds;
} else {
- riseSetToTwilight = seaLevelSunrise!.valueOf() - twilight!.valueOf();
+ riseSetToTwilight = seaLevelSunrise!.epochMilliseconds - twilight!.epochMilliseconds;
}
return riseSetToTwilight / shaahZmanis;
@@ -1245,7 +1246,7 @@ export class ZmanimCalendar extends AstronomicalCalendar {
*
* @see ComplexZmanimCalendar#getFixedLocalChatzos()
*/
- public getHalfDayBasedZman(startOfHalfDay: DateTime | null, endOfHalfDay: DateTime | null, hours: number): DateTime | null {
+ public getHalfDayBasedZman(startOfHalfDay: Temporal.ZonedDateTime | null, endOfHalfDay: Temporal.ZonedDateTime | null, hours: number): Temporal.ZonedDateTime | null {
if (startOfHalfDay === null || endOfHalfDay === null) return null;
const shaahZmanis: number = this.getHalfDayBasedShaahZmanis(startOfHalfDay, endOfHalfDay);
@@ -1272,8 +1273,8 @@ export class ZmanimCalendar extends AstronomicalCalendar {
* @see #isUseAstronomicalChatzosForOtherZmanim()
* @todo Consider adjusting various shaah zmanis times to use this.
*/
- public getHalfDayBasedShaahZmanis(startOfHalfDay: DateTime | null, endOfHalfDay: DateTime | null): number {
+ public getHalfDayBasedShaahZmanis(startOfHalfDay: Temporal.ZonedDateTime | null, endOfHalfDay: Temporal.ZonedDateTime | null): number {
if (startOfHalfDay === null || endOfHalfDay === null) return Long_MIN_VALUE;
- return (endOfHalfDay.valueOf() - startOfHalfDay.valueOf()) / 6;
+ return (endOfHalfDay.epochMilliseconds - startOfHalfDay.epochMilliseconds) / 6;
}
}
diff --git a/src/hebrewcalendar/HebrewDateFormatter.ts b/src/hebrewcalendar/HebrewDateFormatter.ts
index ab39a3e..a0db4ab 100644
--- a/src/hebrewcalendar/HebrewDateFormatter.ts
+++ b/src/hebrewcalendar/HebrewDateFormatter.ts
@@ -1,4 +1,4 @@
-import { DateTimeFormatOptions } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { Daf } from './Daf';
import { JewishDate } from './JewishDate';
@@ -56,7 +56,7 @@ export class HebrewDateFormatter {
/**
* The internal DateFormat. See {@link #isLongWeekFormat()} and {@link #setLongWeekFormat(boolean)}.
*/
- private weekFormat: DateTimeFormatOptions | null = { weekday: 'long' };
+ private weekFormat: Intl.DateTimeFormatOptions | null = { weekday: 'long' };
/**
* List of transliterated parshiyos using the default Ashkenazi pronounciation. The formatParsha method uses this
@@ -639,8 +639,8 @@ export class HebrewDateFormatter {
const dateTime = jewishDate.getDate();
return this.weekFormat
- ? dateTime.toLocaleString(this.weekFormat)
- : dateTime.toISO();
+ ? dateTime.toLocaleString('en-US', this.weekFormat)
+ : dateTime.toString();
}
/**
@@ -911,7 +911,8 @@ export class HebrewDateFormatter {
* @see #isHebrewFormat()
*
*/
- public formatHebrewNumber(num: number): string {
+ public formatHebrewNumber(num0: number): string {
+ let num: number = num0;
if (num !== Math.trunc(num)) throw new IllegalArgumentException('number must be an integer.');
if (num < 0) {
diff --git a/src/hebrewcalendar/JewishCalendar.ts b/src/hebrewcalendar/JewishCalendar.ts
index 9f19cdf..aada463 100644
--- a/src/hebrewcalendar/JewishCalendar.ts
+++ b/src/hebrewcalendar/JewishCalendar.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { GeoLocation } from '../util/GeoLocation';
import { Daf } from './Daf';
@@ -359,11 +359,11 @@ export class JewishCalendar extends JewishDate {
*/
constructor(jewishYear: number, jewishMonth: number, jewishDayOfMonth: number, inIsrael?: boolean)
constructor(date: Date)
- constructor(date: DateTime)
+ constructor(date: Temporal.PlainDate)
constructor()
- constructor(jewishYearOrDateTimeOrDate?: number | Date | DateTime, jewishMonth?: number, jewishDayOfMonth?: number, inIsrael?: boolean) {
+ constructor(jewishYearOrDateTime?: number | Date | Temporal.PlainDate, jewishMonth?: number, jewishDayOfMonth?: number, inIsrael?: boolean) {
// @ts-ignore
- super(jewishYearOrDateTimeOrDate, jewishMonth, jewishDayOfMonth);
+ super(jewishYearOrDateTime, jewishMonth, jewishDayOfMonth);
if (inIsrael) this.setInIsrael(inIsrael);
}
@@ -1347,7 +1347,7 @@ export class JewishCalendar extends JewishDate {
*
* @return the Date representing the moment of the molad in Yerushalayim standard time (GMT + 2)
*/
- public getMoladAsDate(): DateTime {
+ public getMoladAsDate(): Temporal.ZonedDateTime {
const molad: JewishDate = this.getMolad();
const locationName: string = 'Jerusalem, Israel';
@@ -1364,7 +1364,7 @@ export class JewishCalendar extends JewishDate {
// subtract local time difference of 20.94 minutes (20 minutes and 56.496 seconds) to get to Standard time
const milliseconds: number = Math.trunc(1000 * (moladSeconds - Math.trunc(moladSeconds)));
- return DateTime.fromObject({
+ return Temporal.ZonedDateTime.from({
year: molad.getGregorianYear(),
month: molad.getGregorianMonth() + 1,
day: molad.getGregorianDayOfMonth(),
@@ -1372,9 +1372,9 @@ export class JewishCalendar extends JewishDate {
minute: molad.getMoladMinutes(),
second: Math.trunc(moladSeconds),
millisecond: milliseconds,
- zone: geo.getTimeZone(),
+ timeZone: geo.getTimeZone(),
})
- .minus({ milliseconds: Math.trunc(geo.getLocalMeanTimeOffset()) });
+ .subtract({ milliseconds: Math.trunc(geo.getLocalMeanTimeOffset()) });
}
/**
@@ -1387,10 +1387,10 @@ export class JewishCalendar extends JewishDate {
* @see ComplexZmanimCalendar#getTchilasZmanKidushLevana3Days()
* @see ComplexZmanimCalendar#getTchilasZmanKidushLevana3Days(Date, Date)
*/
- public getTchilasZmanKidushLevana3Days(): DateTime {
- const molad: DateTime = this.getMoladAsDate();
+ public getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime {
+ const molad: Temporal.ZonedDateTime = this.getMoladAsDate();
- return molad.plus({ hours: 72 });
+ return molad.add({ hours: 72 });
}
/**
@@ -1405,10 +1405,10 @@ export class JewishCalendar extends JewishDate {
* @see ComplexZmanimCalendar#getTchilasZmanKidushLevana7Days()
* @see ComplexZmanimCalendar#getTchilasZmanKidushLevana7Days(Date, Date)
*/
- public getTchilasZmanKidushLevana7Days(): DateTime {
- const molad: DateTime = this.getMoladAsDate();
+ public getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime {
+ const molad: Temporal.ZonedDateTime = this.getMoladAsDate();
- return molad.plus({ hours: 168 });
+ return molad.add({ hours: 168 });
}
/**
@@ -1425,13 +1425,13 @@ export class JewishCalendar extends JewishDate {
* @see ComplexZmanimCalendar#getSofZmanKidushLevanaBetweenMoldos()
* @see ComplexZmanimCalendar#getSofZmanKidushLevanaBetweenMoldos(Date, Date)
*/
- public getSofZmanKidushLevanaBetweenMoldos(): DateTime {
- const molad: DateTime = this.getMoladAsDate();
+ public getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime {
+ const molad: Temporal.ZonedDateTime = this.getMoladAsDate();
// add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3
// seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid
// DST/ST crossover issues.
- return molad.plus({
+ return molad.add({
hours: (24 * 14) + 18,
minutes: 22,
seconds: 1,
@@ -1456,11 +1456,11 @@ export class JewishCalendar extends JewishDate {
* @see ComplexZmanimCalendar#getSofZmanKidushLevana15Days()
* @see ComplexZmanimCalendar#getSofZmanKidushLevana15Days(Date, Date)
*/
- public getSofZmanKidushLevana15Days(): DateTime {
- const molad: DateTime = this.getMoladAsDate();
+ public getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime {
+ const molad: Temporal.ZonedDateTime = this.getMoladAsDate();
// 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.
- return molad.plus({ hours: 24 * 15 });
+ return molad.add({ hours: 24 * 15 });
}
/**
diff --git a/src/hebrewcalendar/JewishDate.ts b/src/hebrewcalendar/JewishDate.ts
index 59822c1..e429f22 100644
--- a/src/hebrewcalendar/JewishDate.ts
+++ b/src/hebrewcalendar/JewishDate.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { Calendar, IntegerUtils } from '../polyfills/Utils';
import { IllegalArgumentException } from '../polyfills/errors';
@@ -939,17 +939,18 @@ export class JewishDate {
constructor(jewishYear: number, jewishMonth: number, jewishDayOfMonth: number)
constructor(molad: number)
constructor(date: Date)
- constructor(date: DateTime)
+ constructor(date: Temporal.PlainDate)
constructor()
- constructor(jewishYearOrDateTimeOrDateOrMolad?: number | Date | DateTime, jewishMonth?: number, jewishDayOfMonth?: number) {
+ constructor(jewishYearOrDateTimeOrDateOrMolad?: number | Date | Temporal.PlainDate, jewishMonth?: number, jewishDayOfMonth?: number) {
if (!jewishYearOrDateTimeOrDateOrMolad) {
this.resetDate();
} else if (jewishMonth) {
this.setJewishDate(jewishYearOrDateTimeOrDateOrMolad as number, jewishMonth, jewishDayOfMonth!);
} else if (jewishYearOrDateTimeOrDateOrMolad instanceof Date) {
- this.setDate(DateTime.fromJSDate(jewishYearOrDateTimeOrDateOrMolad as Date));
- } else if (DateTime.isDateTime(jewishYearOrDateTimeOrDateOrMolad)) {
- this.setDate(jewishYearOrDateTimeOrDateOrMolad as DateTime);
+ const instant = Temporal.Instant.fromEpochMilliseconds(jewishYearOrDateTimeOrDateOrMolad.getTime());
+ this.setDate(instant.toZonedDateTimeISO('UTC').toPlainDate());
+ } else if (jewishYearOrDateTimeOrDateOrMolad instanceof Temporal.PlainDate) {
+ this.setDate(jewishYearOrDateTimeOrDateOrMolad as Temporal.PlainDate);
} else if (typeof jewishYearOrDateTimeOrDateOrMolad === 'number') {
const molad = jewishYearOrDateTimeOrDateOrMolad as number;
this.absDateToDate(JewishDate.moladToAbsDate(molad));
@@ -1028,7 +1029,7 @@ export class JewishDate {
* @throws IllegalArgumentException
* if the {@link Calendar#ERA} is {@link GregorianCalendar#BC}
*/
- public setDate(date: DateTime): void {
+ public setDate(date: Temporal.PlainDate): void {
if (date.year < 1) {
throw new IllegalArgumentException(`Dates with a BC era are not supported. The year ${date.year} is invalid.`);
}
@@ -1183,8 +1184,8 @@ export class JewishDate {
*
* @return The {@link java.util.Calendar}
*/
- public getDate(): DateTime {
- return DateTime.fromObject({
+ public getDate(): Temporal.PlainDate {
+ return Temporal.PlainDate.from({
year: this.gregorianYear,
month: this.gregorianMonth,
day: this.gregorianDayOfMonth,
@@ -1195,7 +1196,7 @@ export class JewishDate {
* Resets this date to the current system date.
*/
public resetDate(): void {
- this.setDate(DateTime.local());
+ this.setDate(Temporal.Now.plainDateISO());
}
/**
diff --git a/src/hebrewcalendar/YerushalmiYomiCalculator.ts b/src/hebrewcalendar/YerushalmiYomiCalculator.ts
index d0c5785..4d20f0b 100644
--- a/src/hebrewcalendar/YerushalmiYomiCalculator.ts
+++ b/src/hebrewcalendar/YerushalmiYomiCalculator.ts
@@ -1,4 +1,4 @@
-import { DateTime, Interval } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { Calendar } from '../polyfills/Utils';
import { Daf } from './Daf';
@@ -16,7 +16,7 @@ export class YerushalmiYomiCalculator {
/**
* The start date of the first Daf Yomi Yerushalmi cycle of February 2, 1980 / 15 Shevat, 5740.
*/
- private static readonly DAF_YOMI_START_DAY: DateTime = DateTime.fromObject({
+ private static readonly DAF_YOMI_START_DAY: Temporal.PlainDate = Temporal.PlainDate.from({
year: 1980,
month: Calendar.FEBRUARY + 1,
day: 2,
@@ -53,9 +53,9 @@ export class YerushalmiYomiCalculator {
* if the date is prior to the February 2, 1980, the start of the first Daf Yomi Yerushalmi cycle
*/
public static getDafYomiYerushalmi(jewishCalendar: JewishCalendar): Daf | null {
- let nextCycle: DateTime = YerushalmiYomiCalculator.DAF_YOMI_START_DAY;
- let prevCycle: DateTime = YerushalmiYomiCalculator.DAF_YOMI_START_DAY;
- const requested: DateTime = jewishCalendar.getDate();
+ let nextCycle: Temporal.PlainDate = YerushalmiYomiCalculator.DAF_YOMI_START_DAY;
+ let prevCycle: Temporal.PlainDate = YerushalmiYomiCalculator.DAF_YOMI_START_DAY;
+ const requested: Temporal.PlainDate = jewishCalendar.getDate();
let masechta: number = 0;
let dafYomi: Daf;
@@ -64,7 +64,7 @@ export class YerushalmiYomiCalculator {
return null;
}
- if (requested < YerushalmiYomiCalculator.DAF_YOMI_START_DAY) {
+ if (Temporal.PlainDate.compare(requested, YerushalmiYomiCalculator.DAF_YOMI_START_DAY) < 0) {
throw new IllegalArgumentException(`${requested} is prior to organized Daf Yomi Yerushalmi cycles that started on ${YerushalmiYomiCalculator.DAF_YOMI_START_DAY}`);
}
@@ -72,17 +72,17 @@ export class YerushalmiYomiCalculator {
// nextCycle = YerushalmiYomiCalculator.DAF_YOMI_START_DAY;
// Go cycle by cycle, until we get the next cycle
- while (requested > nextCycle) {
+ while (Temporal.PlainDate.compare(requested, nextCycle) > 0) {
prevCycle = nextCycle;
// Adds the number of whole shas dafs, and then the number of days that not have daf.
- nextCycle = nextCycle.plus({ days: YerushalmiYomiCalculator.WHOLE_SHAS_DAFS });
+ nextCycle = nextCycle.add({ days: YerushalmiYomiCalculator.WHOLE_SHAS_DAFS });
// This needs to be a separate step
- nextCycle = nextCycle.plus({ days: YerushalmiYomiCalculator.getNumOfSpecialDays(prevCycle, nextCycle) });
+ nextCycle = nextCycle.add({ days: YerushalmiYomiCalculator.getNumOfSpecialDays(prevCycle, nextCycle) });
}
// Get the number of days from cycle start until request.
- const dafNo: number = requested.diff(prevCycle, ['days']).days;
+ const dafNo: number = requested.since(prevCycle).days;
// Get the number of special days to subtract
const specialDays: number = YerushalmiYomiCalculator.getNumOfSpecialDays(prevCycle, requested);
@@ -110,7 +110,7 @@ export class YerushalmiYomiCalculator {
* @param end - end date to calculate at
* @return the number of special days between the start and end dates
*/
- private static getNumOfSpecialDays(start: DateTime, end: DateTime): number {
+ private static getNumOfSpecialDays(start: Temporal.PlainDate, end: Temporal.PlainDate): number {
// Find the start and end Jewish years
const jewishStartYear: number = new JewishCalendar(start).getJewishYear();
const jewishEndYear: number = new JewishCalendar(end).getJewishYear();
@@ -127,9 +127,14 @@ export class YerushalmiYomiCalculator {
yomKippur.setJewishYear(i);
tishaBeav.setJewishYear(i);
- const interval = Interval.fromDateTimes(start, end);
- if (interval.contains(yomKippur.getDate())) specialDays++;
- if (interval.contains(tishaBeav.getDate())) specialDays++;
+ const yk = yomKippur.getDate();
+ if (Temporal.PlainDate.compare(yk, start) >= 0 && Temporal.PlainDate.compare(yk, end) <= 0) {
+ specialDays++;
+ }
+ const av9 = tishaBeav.getDate();
+ if (Temporal.PlainDate.compare(av9, start) >= 0 && Temporal.PlainDate.compare(av9, end) <= 0) {
+ specialDays++;
+ }
}
return specialDays;
diff --git a/src/hebrewcalendar/YomiCalculator.ts b/src/hebrewcalendar/YomiCalculator.ts
index 3db647f..a388591 100644
--- a/src/hebrewcalendar/YomiCalculator.ts
+++ b/src/hebrewcalendar/YomiCalculator.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { Calendar } from '../polyfills/Utils';
import { Daf } from './Daf';
@@ -17,7 +17,7 @@ export class YomiCalculator {
/**
* The start date of the first Daf Yomi Bavli cycle of September 11, 1923 / Rosh Hashana 5684.
*/
- private static readonly dafYomiStartDate: DateTime = DateTime.fromObject({
+ private static readonly dafYomiStartDate: Temporal.PlainDate = Temporal.PlainDate.from({
year: 1923,
month: Calendar.SEPTEMBER + 1,
day: 11,
@@ -30,7 +30,7 @@ export class YomiCalculator {
* The date that the pagination for the Daf Yomi Maseches Shekalim changed to use the commonly used Vilna
* Shas pagination from the no longer commonly available Zhitomir / Slavuta Shas used by Rabbi Meir Shapiro.
*/
- private static readonly shekalimChangeDate: DateTime = DateTime.fromObject({ year: 1975, month: Calendar.JUNE + 1, day: 24 });
+ private static readonly shekalimChangeDate: Temporal.PlainDate = Temporal.PlainDate.from({ year: 1975, month: Calendar.JUNE + 1, day: 24 });
/** The Julian date that the cycle for Shekalim changed.
* @see #getDafYomiBavli(JewishCalendar) for details.
@@ -78,17 +78,18 @@ export class YomiCalculator {
const blattPerMasechta: number[] = [64, 157, 105, 121, 22, 88, 56, 40, 35, 31, 32, 29, 27, 122, 112, 91, 66, 49, 90, 82,
119, 119, 176, 113, 24, 49, 76, 14, 120, 110, 142, 61, 34, 34, 28, 22, 4, 9, 5, 73];
- const date: DateTime = calendar.getDate();
+ const date: Temporal.PlainDate = calendar.getDate();
let dafYomi: Daf;
const julianDay: number = this.getJulianDay(date);
let cycleNo: number;
let dafNo: number;
- if (date < YomiCalculator.dafYomiStartDate) {
+ if (Temporal.PlainDate.compare(date, YomiCalculator.dafYomiStartDate) < 0) {
// TODO: should we return a null or throw an IllegalArgumentException?
throw new IllegalArgumentException(`${calendar} is prior to organized Daf Yomi Bavli cycles that started on ${YomiCalculator.dafYomiStartDate}`);
}
- if ((date > YomiCalculator.shekalimChangeDate) || date.equals(YomiCalculator.shekalimChangeDate)) {
+ if ((Temporal.PlainDate.compare(date, YomiCalculator.shekalimChangeDate) > 0) ||
+ date.equals(YomiCalculator.shekalimChangeDate)) {
cycleNo = 8 + ((julianDay - YomiCalculator.shekalimJulianChangeDay) / 2711);
dafNo = ((julianDay - YomiCalculator.shekalimJulianChangeDay) % 2711);
} else {
@@ -134,7 +135,7 @@ export class YomiCalculator {
* The Java Date
* @return the Julian day number corresponding to the date
*/
- private static getJulianDay(date: DateTime): number {
+ private static getJulianDay(date: Temporal.PlainDate): number {
let { year, month } = date;
const { day } = date;
diff --git a/src/kosher-zmanim.ts b/src/kosher-zmanim.ts
index 9441db0..0b2266e 100644
--- a/src/kosher-zmanim.ts
+++ b/src/kosher-zmanim.ts
@@ -1,5 +1,4 @@
-import * as _Luxon from 'luxon';
-
+import { Temporal } from 'temporal-polyfill';
import { GeoLocation } from './util/GeoLocation';
import { ZmanimCalendar } from './ZmanimCalendar';
import { ComplexZmanimCalendar } from './ComplexZmanimCalendar';
@@ -12,7 +11,7 @@ export function getZmanimJson(options: Options): JsonOutput {
const zmanimCalendar: ZmanimCalendar = options.complexZmanim
? new ComplexZmanimCalendar(geoLocation)
: new ZmanimCalendar(geoLocation);
- zmanimCalendar.setDate(options.date || _Luxon.DateTime.local());
+ zmanimCalendar.setDate(options.date || Temporal.Now.plainDateISO());
return ZmanimFormatter.toJSON(zmanimCalendar);
}
@@ -20,7 +19,7 @@ export interface Options {
/**
* @default The current local date. The time is ignored.
*/
- date?: Date | string | number | _Luxon.DateTime;
+ date?: Date | string | number | Temporal.PlainDate;
/**
* IANA timezone ID
*/
@@ -60,8 +59,3 @@ export * from './hebrewcalendar/YerushalmiYomiCalculator';
export * from './hebrewcalendar/HebrewDateFormatter';
export * from './util/ZmanimFormatter';
-
-export const Luxon = _Luxon;
-
-// Exported explicitly as a convenience.
-export const DateTime = _Luxon.DateTime;
diff --git a/src/polyfills/Utils.ts b/src/polyfills/Utils.ts
index fc02203..646d78c 100644
--- a/src/polyfills/Utils.ts
+++ b/src/polyfills/Utils.ts
@@ -1,4 +1,4 @@
-import { DateTime, Info } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
export namespace Utils {
// https://stackoverflow.com/a/40577337/8037425
@@ -31,35 +31,26 @@ export namespace TimeZone {
* @return the amount of raw offset time in milliseconds to add to UTC.
*/
export function getRawOffset(timeZoneId: string): number {
- const janDateTime = DateTime.fromObject({
+ const janDateTime = Temporal.ZonedDateTime.from({
+ year: 2019,
month: 1,
day: 1,
- zone: timeZoneId,
+ timeZone: timeZoneId,
});
- const julyDateTime = janDateTime.set({ month: 7 });
+ const julyDateTime = janDateTime.with({ month: 7 });
- let rawOffsetMinutes;
+ let rawOffsetNanoseconds: number;
if (janDateTime.offset === julyDateTime.offset) {
- rawOffsetMinutes = janDateTime.offset;
+ rawOffsetNanoseconds = janDateTime.offsetNanoseconds;
} else {
- const max = Math.max(janDateTime.offset, julyDateTime.offset);
+ const max = Math.max(janDateTime.offsetNanoseconds, julyDateTime.offsetNanoseconds);
- rawOffsetMinutes = max < 0
+ rawOffsetNanoseconds = max < 0
? 0 - max
- : 0 - Math.min(janDateTime.offset, julyDateTime.offset);
+ : 0 - Math.min(janDateTime.offsetNanoseconds, julyDateTime.offsetNanoseconds);
}
- return rawOffsetMinutes * 60 * 1000;
- }
-
- /**
- * Returns a name in the specified style of this TimeZone suitable for presentation to the user in the default locale.
- * @param {string} timeZoneId
- * @param {DateTime} [date]
- * @param {boolean} [short]
- */
- export function getDisplayName(timeZoneId: string, date: DateTime = DateTime.local(), short: boolean = false): string {
- return Info.normalizeZone(timeZoneId).offsetName(date.toMillis(), { format: short ? 'short' : 'long' });
+ return Math.trunc(rawOffsetNanoseconds / 1_000_000);
}
/**
@@ -70,7 +61,8 @@ export namespace TimeZone {
* @return {number}
*/
export function getDSTSavings(timeZoneId: string): number {
- return Info.hasDST(timeZoneId) ? 3600000 : 0;
+ return -1;
+ // return Info.hasDST(timeZoneId) ? 3600000 : 0;
}
/**
@@ -83,7 +75,12 @@ export namespace TimeZone {
* @param {number} millisSinceEpoch
*/
export function getOffset(timeZoneId: string, millisSinceEpoch: number): number {
- return Info.normalizeZone(timeZoneId).offset(millisSinceEpoch) * 60 * 1000;
+ const instant = Temporal.Instant.fromEpochMilliseconds(millisSinceEpoch);
+ const zdt = instant.toZonedDateTimeISO(timeZoneId);
+ const [hour, min] = zdt.offset.split(':').map((s: string) => parseInt(s, 10));
+ const h60 = hour * 60;
+ const minutes = hour < 0 ? h60 - min : h60 + min;
+ return minutes * 60 * 1000;
}
}
diff --git a/src/util/AstronomicalCalculator.ts b/src/util/AstronomicalCalculator.ts
index a08dca6..7547fd8 100644
--- a/src/util/AstronomicalCalculator.ts
+++ b/src/util/AstronomicalCalculator.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { GeoLocation } from './GeoLocation';
import { MathUtils } from '../polyfills/Utils';
@@ -110,7 +110,7 @@ export abstract class AstronomicalCalculator {
* {@link java.lang.Double#NaN} will be returned.
* @see #getElevationAdjustment(double)
*/
- public abstract getUTCSunrise(date: DateTime, geoLocation: GeoLocation, zenith: number,
+ public abstract getUTCSunrise(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number,
adjustForElevation: boolean): number; // eslint-disable-line @typescript-eslint/indent
/**
@@ -134,7 +134,7 @@ export abstract class AstronomicalCalculator {
* {@link java.lang.Double#NaN} will be returned.
* @see #getElevationAdjustment(double)
*/
- public abstract getUTCSunset(date: DateTime, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
+ public abstract getUTCSunset(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number;
/**
* Return solar noon (UTC) for the given day at the
@@ -149,7 +149,7 @@ export abstract class AstronomicalCalculator {
*
* @return the time in minutes from zero UTC
*/
- public abstract getUTCNoon(date: DateTime, geoLocation: GeoLocation): number;
+ public abstract getUTCNoon(date: Temporal.PlainDate, geoLocation: GeoLocation): number;
/**
* Return solar midnight (UTC) for the given day at the
@@ -164,7 +164,7 @@ export abstract class AstronomicalCalculator {
*
* @return the time in minutes from zero UTC
*/
- public abstract getUTCMidnight(date: DateTime, geoLocation: GeoLocation): number;
+ public abstract getUTCMidnight(date: Temporal.PlainDate, geoLocation: GeoLocation): number;
/**
* Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher
diff --git a/src/util/GeoLocation.ts b/src/util/GeoLocation.ts
index 2a3550a..f80d69f 100644
--- a/src/util/GeoLocation.ts
+++ b/src/util/GeoLocation.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { MathUtils, TimeZone } from '../polyfills/Utils';
import { IllegalArgumentException, UnsupportedError } from '../polyfills/errors';
@@ -631,10 +631,8 @@ export class GeoLocation {
.concat(`\nLongitude:\t\t\t${this.getLongitude().toString()}\u00B0`)
.concat(`\nElevation:\t\t\t${this.getElevation().toString()} Meters`)
.concat(`\nTimezone ID:\t\t\t${this.getTimeZone()}`)
- .concat(`\nTimezone Display Name:\t\t${TimeZone.getDisplayName(this.getTimeZone())}`)
- .concat(` (${TimeZone.getDisplayName(this.getTimeZone(), DateTime.local(), true)})`)
.concat(`\nTimezone GMT Offset:\t\t${(TimeZone.getRawOffset(this.getTimeZone()) / GeoLocation.HOUR_MILLIS).toString()}`)
- .concat(`\nTimezone DST Offset:\t\t${(TimeZone.getDSTSavings(this.getTimeZone()) / GeoLocation.HOUR_MILLIS).toString()}`);
+ // .concat(`\nTimezone DST Offset:\t\t${(TimeZone.getDSTSavings(this.getTimeZone()) / GeoLocation.HOUR_MILLIS).toString()}`);
}
/**
diff --git a/src/util/NOAACalculator.ts b/src/util/NOAACalculator.ts
index acd82f0..fbaae7a 100644
--- a/src/util/NOAACalculator.ts
+++ b/src/util/NOAACalculator.ts
@@ -1,4 +1,4 @@
-import { DateTime } from 'luxon';
+import { Temporal } from 'temporal-polyfill';
import { GeoLocation } from './GeoLocation';
import { AstronomicalCalculator } from './AstronomicalCalculator';
@@ -63,7 +63,7 @@ export class NOAACalculator extends AstronomicalCalculator {
/**
* @see AstronomicalCalculator#getUTCSunrise(Calendar, GeoLocation, double, boolean)
*/
- public getUTCSunrise(date: DateTime, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number {
+ public getUTCSunrise(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number {
const elevation: number = adjustForElevation ? geoLocation.getElevation() : 0;
const adjustedZenith: number = this.adjustZenith(zenith, elevation);
@@ -77,7 +77,7 @@ export class NOAACalculator extends AstronomicalCalculator {
/**
* @see AstronomicalCalculator#getUTCSunset(Calendar, GeoLocation, double, boolean)
*/
- public getUTCSunset(date: DateTime, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number {
+ public getUTCSunset(date: Temporal.PlainDate, geoLocation: GeoLocation, zenith: number, adjustForElevation: boolean): number {
const elevation: number = adjustForElevation ? geoLocation.getElevation() : 0;
const adjustedZenith: number = this.adjustZenith(zenith, elevation);
@@ -96,7 +96,7 @@ export class NOAACalculator extends AstronomicalCalculator {
* @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days
* should be added later.
*/
- private static getJulianDay(date: DateTime): number {
+ private static getJulianDay(date: Temporal.PlainDate): number {
let { year, month } = date;
const { day } = date;
if (month <= 2) {
@@ -341,8 +341,8 @@ export class NOAACalculator extends AstronomicalCalculator {
* @return solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees
*/
- public static getSolarElevation(date: DateTime, latitude: number, longitude: number): number {
- const julianDay: number = NOAACalculator.getJulianDay(date);
+ public static getSolarElevation(date: Temporal.ZonedDateTime, latitude: number, longitude: number): number {
+ const julianDay: number = NOAACalculator.getJulianDay(date.toPlainDate());
const julianCenturies: number = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);
const eot: number = NOAACalculator.getEquationOfTime(julianCenturies);
let adjustedLongitude: number = (date.hour + 12) + (date.minute + eot + date.second / 60) / 60;
@@ -370,8 +370,8 @@ export class NOAACalculator extends AstronomicalCalculator {
* @return FIXME
*/
- public static getSolarAzimuth(date: DateTime, latitude: number, longitude: number): number {
- const julianDay: number = NOAACalculator.getJulianDay(date);
+ public static getSolarAzimuth(date: Temporal.ZonedDateTime, latitude: number, longitude: number): number {
+ const julianDay: number = NOAACalculator.getJulianDay(date.toPlainDate());
const julianCenturies: number = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);
const eot: number = NOAACalculator.getEquationOfTime(julianCenturies);
let adjustedLongitude: number = (date.hour + 12) + (date.minute + eot + date.second / 60) / 60;
@@ -403,7 +403,7 @@ export class NOAACalculator extends AstronomicalCalculator {
* the longitude for calculating noon since it is the same time anywhere along the longitude line.
* @return the time in minutes from zero UTC
*/
- public getUTCNoon(date: DateTime, geoLocation: GeoLocation): number {
+ public getUTCNoon(date: Temporal.PlainDate, geoLocation: GeoLocation): number {
let noon = NOAACalculator.getSolarNoonMidnightUTC(NOAACalculator.getJulianDay(date), -geoLocation.getLongitude(), NOAACalculator.SolarEvent.NOON);
noon = noon / 60;
@@ -428,7 +428,7 @@ export class NOAACalculator extends AstronomicalCalculator {
* the longitude for calculating noon since it is the same time anywhere along the longitude line.
* @return the time in minutes from zero UTC
*/
- public getUTCMidnight(date: DateTime, geoLocation: GeoLocation): number {
+ public getUTCMidnight(date: Temporal.PlainDate, geoLocation: GeoLocation): number {
let midnight: number = NOAACalculator.getSolarNoonMidnightUTC(NOAACalculator.getJulianDay(date), -geoLocation.getLongitude(), NOAACalculator.SolarEvent.MIDNIGHT);
midnight = midnight / 60;
return midnight > 0 ? midnight % 24 : (midnight % 24) + 24; // ensure that the time is >= 0 and < 24
@@ -483,7 +483,7 @@ export class NOAACalculator extends AstronomicalCalculator {
* If the calculation is for {@link SolarEvent#SUNRISE SUNRISE} or {@link SolarEvent#SUNSET SUNSET}
* @return the time in minutes from zero Universal Coordinated Time (UTC)
*/
- private static getSunRiseSetUTC(date: DateTime, latitude: number, longitude: number, zenith: number, solarEvent: ValueOf