         
         self.opens = TimeOfDay(string: openHour)
         self.closes = TimeOfDay(string: closeHour)
-        print("Opens: \(opens), Closes: \(closes)")
     }
 }
 

        public var minutes: Int
        public var seconds: Int
        
        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

    public enum Period: Hashable {
        case dayOfWeek(DayOfWeek)
        case dateRange(ClosedRange<Date>)
        
        public func contains(date: Date) -> Bool {
            var cal = Calendar(identifier: .gregorian)
            cal.firstWeekday = 2
            
            switch self {
            case .dayOfWeek(let dayOfWeek):
                
                let weekDay = cal.component(.weekday, from: date)
                
                return dayOfWeek.weekdayComponent == weekDay
                
            case .dateRange(let dateRange):
                return dateRange.contains(date)
            }
        }
    }
    
    public enum DayOfWeek: String, CaseIterable, Hashable, Decodable {
        case sunday, monday, tuesday, wednesday, thursday, friday, saturday
        
        // sunday = 1
        public init?(weekdayComponent: Int) {
            let allDays = Self.allCases
            guard weekdayComponent <= allDays.count else { return nil }
            self = allDays[weekdayComponent - 1]
        }
        // sunday = 1
        public var weekdayComponent: Int {
            return (DayOfWeek.allCases.firstIndex(of: self) ?? 0) + 1
        }
    }
    
