diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e69d684 Binary files /dev/null and b/.DS_Store differ diff --git a/Sources/.DS_Store b/Sources/.DS_Store new file mode 100644 index 0000000..c5256bd Binary files /dev/null and b/Sources/.DS_Store differ diff --git a/Sources/KosherSwift/AstronomicalCalendar.swift b/Sources/KosherSwift/AstronomicalCalendar.swift index aca61dc..b75081c 100644 --- a/Sources/KosherSwift/AstronomicalCalendar.swift +++ b/Sources/KosherSwift/AstronomicalCalendar.swift @@ -553,13 +553,19 @@ public class AstronomicalCalendar { let hours = Int(calculatedTime) calculatedTime -= Double(hours) - let minutes = Int(calculatedTime * 60) - calculatedTime -= Double(minutes) / 60 - let seconds = Int(calculatedTime * 3600) - + + calculatedTime = calculatedTime * 60 + let minutes = Int(calculatedTime) + calculatedTime -= Double(minutes) + + calculatedTime = calculatedTime * 60 + let seconds = Int(calculatedTime) + calculatedTime -= Double(seconds) + components.hour = hours components.minute = minutes components.second = seconds + components.nanosecond = Int(calculatedTime * 1000 * 1000000) var returnDate = gregorianCalendar.date(from: components) diff --git a/Sources/KosherSwift/ComplexZmanimCalendar.swift b/Sources/KosherSwift/ComplexZmanimCalendar.swift index fceb740..08253ac 100644 --- a/Sources/KosherSwift/ComplexZmanimCalendar.swift +++ b/Sources/KosherSwift/ComplexZmanimCalendar.swift @@ -3048,8 +3048,8 @@ public class ComplexZmanimCalendar : ZmanimCalendar { } /** - * Method to return tzais (dusk) calculated as 13.5 minutes zmaniyos. - * + * Method to return tzais (dusk) calculated as 13.5 minutes zmaniyos after sunset. + * - Warning: This zman is EXTREMELY early! It is so early that it was removed from KosherJava since it caused a situation the developer, Eliyahu Hershfeld, was uncomfortable with. The situation was in Canada where a user using his phone saw that this time was listed as the time for nightfall, and he figured that he could end shabbos then. Whie there are no poskim that write to do that! The earliest time that I have found to end shabbos is 20 regular minutes after sunset and that is only in Israel and the surrounding areas. Every where else was recommended 30 minutes at the bare minimum. Therefore, someone who wants to use/include this time has an obligation to make sure that it does not get used for shabbos by dimming it or showing another time. * @return the Date representing the time. If the calculation can't be computed such as in the Arctic * Circle where there is at least one day a year where the sun does not rise, and one where it does not set, * a nil will be returned. See detailed explanation on top of the ``AstronomicalCalendar`` diff --git a/Tests/.DS_Store b/Tests/.DS_Store new file mode 100644 index 0000000..8071fa9 Binary files /dev/null and b/Tests/.DS_Store differ diff --git a/Tests/KosherSwiftTests/KosherSwiftTests.swift b/Tests/KosherSwiftTests/KosherSwiftTests.swift index 4e57e60..e628851 100644 --- a/Tests/KosherSwiftTests/KosherSwiftTests.swift +++ b/Tests/KosherSwiftTests/KosherSwiftTests.swift @@ -399,7 +399,6 @@ class KosherSwiftTests: XCTestCase { let calculator = ComplexZmanimCalendar(location: geoLocation) let format = DateFormatter() format.timeStyle = .full - calculator.astronomicalCalculator = SunTimesCalculator() print(format.string(from: calculator.getSeaLevelSunrise()!)) print(format.string(from: calculator.getSeaLevelSunset()!)) }