     }
 }
 
-
-private extension Date {
-    func isAfterDate(date: Date) -> Bool {
-        return NSDate(timeIntervalSinceNow: self.timeIntervalSinceNow).earlierDate(date) == date
-    }
-
-    func isBeforeDate(date: Date) -> Bool {
-        return NSDate(timeIntervalSinceNow: self.timeIntervalSinceNow).earlierDate(date) == self
-    }
-}
-

        }
    }

    override func viewDidLoad() {
        super.viewDidLoad()



        sunriseSet.calculateSunriseSunset(today)

        guard let sunrise = sunriseSet.localSunrise(),
            let sunset = sunriseSet.localSunset(),
            let calendar = NSCalendar(identifier: NSCalendar.Identifier.gregorian) else {
                return self.sunriseSetTimesLabel.text = nil
        }

        let sunriseToday = updateDateComponents(dateComponents: sunrise, toDate: today, withCalendar: calendar)

        let dateFormatter = DateFormatter()
        dateFormatter.dateFormat = "h:mm a"

        if let sunriseTime = calendar.date(from: sunriseToday),
            sunriseTime > today {
            let timeAsString = dateFormatter.string(from: sunriseTime)
            return self.sunriseSetTimesLabel.text = "Sunrise is at \(timeAsString) today"
        }

        let sunsetToday = updateDateComponents(dateComponents: sunset, toDate: today, withCalendar: calendar)

        if let sunsetTime = calendar.date(from: sunsetToday),
            sunsetTime > today {
            let timeAsString = dateFormatter.string(from: sunsetTime)
            return self.sunriseSetTimesLabel.text = "Sunset is at \(timeAsString) today"
        }
