         self.closes = closes
     }
     
-    func contains(date: Date) -> Bool {
-        var cal = Calendar(identifier: .gregorian)
-        cal.firstWeekday = 2
-        
-        switch period {
-        case .dayOfWeek(let dayOfWeek):
-            
-            let weekDay = cal.component(.weekday, from: date)
-            
-            if dayOfWeek.weekdayComponent != weekDay {
-                return false
-            }
-            
-        case .dateRange(let dateRange):
-            if !dateRange.contains(date) {
-                return false
-            }
-        }
-
+    public func contains(date: Date) -> Bool {
+        
+        guard period.contains(date: date) else { return false }
+
+        let cal = Calendar(identifier: .gregorian)
         let openDate = cal.date(bySettingHour: opens.hours, minute: opens.minutes, second: opens.seconds, of: date) ?? .distantPast
         let closeDate = cal.date(bySettingHour: closes.hours, minute: closes.minutes, second: closes.seconds, of: date) ?? .distantFuture
         

    public enum Period: Hashable {
        case dayOfWeek(DayOfWeek)
        case dateRange(ClosedRange<Date>)
    }
    
    public enum DayOfWeek: String, CaseIterable, Hashable, Decodable {
        case monday, tuesday, wednesday, thursday, friday, saturday, sunday
        
        var weekdayComponent: Int {
            return DayOfWeek.allCases.firstIndex(of: self) ?? 0
        }
    }
    

        public var minutes: Int
        public var seconds: Int
        
        public init(string: String) {
            let components = string.components(separatedBy: ":").compactMap(Int.init)
            self.hours = components.count > 0 ? components[0] : 0
            self.minutes = components.count > 1 ? components[1] : 0
