Skip to content

Commit

Permalink
Fixed "down" typos (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
seldon1000 authored Apr 25, 2023
1 parent cce6e9d commit 2f02378
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ To properly show the Sun Date Events use the following DateFormatter.
* Astronomical Dusk
* Astronomical Dawn
* Nautical Dusk
* Nautical Down
* Nautical Dawn
* Morning Blue Hour Time
* Evening Blue Hour Time
* Sun Azimuth at Sunrise
Expand Down
16 changes: 8 additions & 8 deletions Sources/SunKit/Sun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public class Sun {

///Date at which there is the Nautical Dusk
public private(set) var nauticalDusk: Date = Date()
///Date at which there is the Nautical Down
public private(set) var nauticalDown: Date = Date()
///Date at which there is the Nautical Dawn
public private(set) var nauticalDawn: Date = Date()

///Date at which there is the Astronomical Dusk
public private(set) var astronomicalDusk: Date = Date()
Expand Down Expand Up @@ -324,7 +324,7 @@ public class Sun {
print("Civil dusk -> \(dateFormatter.string(from: civilDusk))")
print("Civil Dawn -> \(dateFormatter.string(from: civilDawn))")
print("Nautical Dusk -> \(dateFormatter.string(from: nauticalDusk))")
print("Nautical Down -> \(dateFormatter.string(from: nauticalDown))")
print("Nautical Dawn -> \(dateFormatter.string(from: nauticalDawn))")
print("Astronomical Dusk -> \(dateFormatter.string(from: astronomicalDusk))")
print("Astronomical Dawn -> \(dateFormatter.string(from: astronomicalDawn))")
print("Morning Blue Hour Start -> \(dateFormatter.string(from: morningBlueHourStart))")
Expand Down Expand Up @@ -442,7 +442,7 @@ public class Sun {
self.civilDusk = getCivilDusk() ?? Date()
self.civilDawn = getCivilDawn() ?? Date()
self.nauticalDusk = getNauticalDusk() ?? Date()
self.nauticalDown = getNauticalDown() ?? Date()
self.nauticalDawn = getNauticalDawn() ?? Date()
self.astronomicalDusk = getAstronomicalDusk() ?? Date()
self.astronomicalDawn = getAstronomicalDawn() ?? Date()
self.morningGoldenHourStart = getMorningGoldenHourStart() ?? Date()
Expand Down Expand Up @@ -721,12 +721,12 @@ public class Sun {
}

/// Nautical Dusk is when the Sun reaches -12 degrees of elevation.
/// - Returns: Nautical Down
private func getNauticalDown() -> Date? {
guard let nauticalDown = getDateFrom(sunEvent: .nautical, morning: false) else {
/// - Returns: Nautical Dawn
private func getNauticalDawn() -> Date? {
guard let nauticalDawn = getDateFrom(sunEvent: .nautical, morning: false) else {
return nil
}
return nauticalDown
return nauticalDawn
}

/// Astronomical Dusk is when the Sun reaches -18 degrees of elevation.
Expand Down
4 changes: 2 additions & 2 deletions Tests/SunKitTests/UT_Sun.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ final class UT_Sun: XCTestCase {

var expectednauticalDusk = createDateCustomTimeZone(day: 19, month: 11, year: 2022, hour: 5, minute: 52, seconds: 21,timeZone: timeZoneUnderTest)

var expectednauticalDown = createDateCustomTimeZone(day: 19, month: 11, year: 2022, hour: 17, minute: 44, seconds: 45,timeZone: timeZoneUnderTest)
var expectednauticalDawn = createDateCustomTimeZone(day: 19, month: 11, year: 2022, hour: 17, minute: 44, seconds: 45,timeZone: timeZoneUnderTest)

var expectedastronomicalDusk = createDateCustomTimeZone(day: 19, month: 11, year: 2022, hour: 5, minute: 19, seconds: 25,timeZone: timeZoneUnderTest)

Expand All @@ -124,7 +124,7 @@ final class UT_Sun: XCTestCase {
XCTAssertTrue(abs(expectedSolarNoon.timeIntervalSince1970 - sunUnderTest.solarNoon.timeIntervalSince1970) < UT_Sun.sunSetRiseThresholdInSeconds)

XCTAssertTrue(abs(expectednauticalDusk.timeIntervalSince1970 - sunUnderTest.nauticalDusk.timeIntervalSince1970) < UT_Sun.sunSetRiseThresholdInSeconds)
XCTAssertTrue(abs(expectednauticalDown.timeIntervalSince1970 - sunUnderTest.nauticalDown.timeIntervalSince1970) < UT_Sun.sunSetRiseThresholdInSeconds)
XCTAssertTrue(abs(expectednauticalDawn.timeIntervalSince1970 - sunUnderTest.nauticalDawn.timeIntervalSince1970) < UT_Sun.sunSetRiseThresholdInSeconds)

XCTAssertTrue(abs(expectedastronomicalDusk.timeIntervalSince1970 - sunUnderTest.astronomicalDusk.timeIntervalSince1970) < UT_Sun.sunSetRiseThresholdInSeconds)

Expand Down

0 comments on commit 2f02378

Please sign in to comment.