Skip to content

Commit a13c6e7

Browse files
committed
Fix lint errors
1 parent 5ee9111 commit a13c6e7

File tree

7 files changed

+248
-243
lines changed

7 files changed

+248
-243
lines changed

src/AstronomicalCalendar.ts

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -248,26 +248,26 @@ export class AstronomicalCalendar {
248248
return this.getSunsetOffsetByDegrees(AstronomicalCalendar.ASTRONOMICAL_ZENITH);
249249
}
250250

251-
/**
252-
* A utility method that returns a date offset by the offset time passed in. Please note that the level of light
253-
* during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or
254-
* after sunset with the intent of getting a rough "level of light" calculation, the sunrise or sunset time passed
255-
* to this method should be sea level sunrise and sunset.
256-
*
257-
* @param time
258-
* the start time
259-
* @param offset
260-
* the offset in milliseconds to add to the time.
261-
* @return the {@link java.util.Date} with the offset in milliseconds added to it
262-
*/
263-
public static getTimeOffset(time: DateTime | null, offset: number): DateTime | null {
264-
if (time === null || offset === Long_MIN_VALUE || Number.isNaN(offset)) {
265-
return null;
266-
}
267-
268-
return time.plus( { milliseconds: offset });
251+
/**
252+
* A utility method that returns a date offset by the offset time passed in. Please note that the level of light
253+
* during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or
254+
* after sunset with the intent of getting a rough "level of light" calculation, the sunrise or sunset time passed
255+
* to this method should be sea level sunrise and sunset.
256+
*
257+
* @param time
258+
* the start time
259+
* @param offset
260+
* the offset in milliseconds to add to the time.
261+
* @return the {@link java.util.Date} with the offset in milliseconds added to it
262+
*/
263+
public static getTimeOffset(time: DateTime | null, offset: number): DateTime | null {
264+
if (time === null || offset === Long_MIN_VALUE || Number.isNaN(offset)) {
265+
return null;
269266
}
270267

268+
return time.plus({ milliseconds: offset });
269+
}
270+
271271
/**
272272
* A utility method that returns the time of an offset by degrees below or above the horizon of
273273
* {@link #getSunrise() sunrise}. Note that the degree offset is from the vertical, so for a calculation of 14°
@@ -444,7 +444,7 @@ export class AstronomicalCalendar {
444444
* @see #getTemporalHour()
445445
*/
446446
public getTemporalHour(startOfday: DateTime | null = this.getSeaLevelSunrise(),
447-
endOfDay: DateTime | null = this.getSeaLevelSunset()): number {
447+
endOfDay: DateTime | null = this.getSeaLevelSunset()): number {
448448
if (startOfday === null || endOfDay === null) {
449449
return Long_MIN_VALUE;
450450
}
@@ -471,28 +471,28 @@ export class AstronomicalCalendar {
471471
}
472472
*/
473473

474-
/**
475-
* A method that returns sundial or solar noon. It occurs when the Sun is <a href
476-
* ="http://en.wikipedia.org/wiki/Transit_%28astronomy%29">transiting</a> the <a
477-
* href="http://en.wikipedia.org/wiki/Meridian_%28astronomy%29">celestial meridian</a>. In this class it is
478-
* calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the
479-
* real transit time due to changes in declination (the lengthening or shortening day).
480-
*
481-
* @param startOfDay
482-
* the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or
483-
* any arbitrary start of day) passed to this method.
484-
* @param endOfDay
485-
* the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any
486-
* arbitrary end of day) passed to this method.
487-
*
488-
* @return the <code>Date</code> representing Sun's transit. If the calculation can't be computed such as in the
489-
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
490-
* not set, null will be returned. See detailed explanation on top of the page.
491-
*/
492-
public getSunTransit(startOfDay: DateTime | null = this.getSeaLevelSunrise(), endOfDay: DateTime | null = this.getSeaLevelSunset()): DateTime | null {
493-
const temporalHour: number = this.getTemporalHour(startOfDay, endOfDay);
494-
return AstronomicalCalendar.getTimeOffset(startOfDay, temporalHour * 6);
495-
}
474+
/**
475+
* A method that returns sundial or solar noon. It occurs when the Sun is <a href
476+
* ="http://en.wikipedia.org/wiki/Transit_%28astronomy%29">transiting</a> the <a
477+
* href="http://en.wikipedia.org/wiki/Meridian_%28astronomy%29">celestial meridian</a>. In this class it is
478+
* calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the
479+
* real transit time due to changes in declination (the lengthening or shortening day).
480+
*
481+
* @param startOfDay
482+
* the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or
483+
* any arbitrary start of day) passed to this method.
484+
* @param endOfDay
485+
* the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any
486+
* arbitrary end of day) passed to this method.
487+
*
488+
* @return the <code>Date</code> representing Sun's transit. If the calculation can't be computed such as in the
489+
* Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
490+
* not set, null will be returned. See detailed explanation on top of the page.
491+
*/
492+
public getSunTransit(startOfDay: DateTime | null = this.getSeaLevelSunrise(), endOfDay: DateTime | null = this.getSeaLevelSunset()): DateTime | null {
493+
const temporalHour: number = this.getTemporalHour(startOfDay, endOfDay);
494+
return AstronomicalCalendar.getTimeOffset(startOfDay, temporalHour * 6);
495+
}
496496

497497
/**
498498
* A method that returns a <code>Date</code> from the time passed in as a parameter.
@@ -550,8 +550,8 @@ export class AstronomicalCalendar {
550550
public getSunriseSolarDipFromOffset(minutes: number): number | null {
551551
if (Number.isNaN(minutes)) return null;
552552

553-
let offsetByDegrees: DateTime | null = this.getSeaLevelSunrise();
554-
const offsetByTime: DateTime | null = AstronomicalCalendar.getTimeOffset(this.getSeaLevelSunrise(), -(minutes * AstronomicalCalendar.MINUTE_MILLIS));
553+
let offsetByDegrees: DateTime | null = this.getSeaLevelSunrise();
554+
const offsetByTime: DateTime | null = AstronomicalCalendar.getTimeOffset(this.getSeaLevelSunrise(), -(minutes * AstronomicalCalendar.MINUTE_MILLIS));
555555

556556
let degrees: Big = new Big(0);
557557
const incrementor: Big = new Big('0.0001');
@@ -577,8 +577,8 @@ export class AstronomicalCalendar {
577577
public getSunsetSolarDipFromOffset(minutes: number): number | null {
578578
if (Number.isNaN(minutes)) return null;
579579

580-
let offsetByDegrees: DateTime | null = this.getSeaLevelSunset();
581-
const offsetByTime: DateTime | null = AstronomicalCalendar.getTimeOffset(this.getSeaLevelSunset(), minutes * AstronomicalCalendar.MINUTE_MILLIS);
580+
let offsetByDegrees: DateTime | null = this.getSeaLevelSunset();
581+
const offsetByTime: DateTime | null = AstronomicalCalendar.getTimeOffset(this.getSeaLevelSunset(), minutes * AstronomicalCalendar.MINUTE_MILLIS);
582582

583583
let degrees: Big = new Big(0);
584584
const incrementor: Big = new Big('0.001');

0 commit comments

Comments
 (0)