     }
 
     func nextOpeningTime(forTime time: Date) -> String? {
-        let dayOfWeek = DayOfWeek.forDate(time)
-        guard let openTime = hours[dayOfWeek]?.openTime,
-            let openingTime = date(forTime: openTime, onDate: time) else {
+        guard let openingTime = getOpeningTime(forDate: time) else {
                 return nil
         }
 

        return OpenHours.calendar.dateComponents(timeComponentsSet, from: dateFromTime)
    }

    /** 
    * The logic for isOpen is as follows:
    * Apply opening time and closing time to the current date (provided as an argument)

        return time >= openingTime && time < closingTime
    }

    private func getDate(forTime time: DateComponents, onDate date: Date) -> Date? {
        var timeDateComponents = dateComponents(fromDate: date)
        timeDateComponents.hour = time.hour
        timeDateComponents.minute = time.minute
