         return nextOpenPeriod
     }
 
-    private func getEarliestOpeningPeriod(fromOpeningPeriods periods: [OpenPeriod]) -> OpenPeriod? {
+    private func getEarliestOpeningPeriod(fromOpeningPeriods periods: [OpenPeriodDates]) -> OpenPeriodDates? {
         return periods.first
     }
 

        }
    }

    private func getCurrentOpeningPeriod(fromOpeningPeriods openingPeriods: [OpenPeriod], forDate date: Date) -> OpenPeriod? {
        let currentPeriods = openingPeriods.filter { isTime(date, duringOpeningPeriod: $0) }
        return currentPeriods.first
    }

    private func getNextOpeningPeriod(fromOpeningPeriods openingPeriods: [OpenPeriod], forDate date: Date) -> OpenPeriod? {
        var nextOpenPeriod: OpenPeriod? = nil
        for openPeriod in openingPeriods {
            if openPeriod.openTime > date {
                guard let currentOpenTime = nextOpenPeriod else {
                    nextOpenPeriod = openPeriod
                    break
                }

                if openPeriod.openTime < currentOpenTime.openTime {
                    nextOpenPeriod = openPeriod
                }
            }

     *   - Use all open intervals
     *   - Use accurate days of week in Date (maybe? It adds complexity for little gain).
     */
    let hours: [DayOfWeek : [OpenPeriodDateComponents]]

    private static let inputTimeFormatter: DateFormatter = {
        let formatter = DateFormatter()
