def next_time(time, closing_time)
      loop do
        min_time = recurrence_rules_with_implicit_start_occurrence.reduce(nil) do |best_time, rule|
          begin
            new_time = rule.next_time(time, start_time, best_time || closing_time)
            [best_time, new_time].compact.min
          rescue StopIteration
            best_time
          end
        end
        break unless min_time
        next (time = min_time + 1) if exception_time?(min_time)
        break Occurrence.new(min_time, min_time + duration)
      end
    end
def next_time(time, closing_time)
      loop do
        min_time = recurrence_rules_with_implicit_start_occurrence.reduce(nil) do |best_time, rule|
          begin
            new_time = rule.next_time(time, start_time, best_time || closing_time)
            [best_time, new_time].compact.min
          rescue StopIteration
            best_time
          end
        end
        break unless min_time
        next (time = min_time + 1) if exception_time?(min_time)
        break Occurrence.new(min_time, min_time + duration)
      end
    end
Get the next time after (or including) a specific time