def in_time_window?(condition)
      if condition.has_key?(:begin) && condition.has_key?(:end)
        begin_time = Time.parse(condition[:begin])
        end_time = Time.parse(condition[:end])
        if end_time < begin_time
          if Time.now < end_time
            begin_time = Time.new(*begin_time.strftime("%Y %m %d 00 00 00 %:z").split("\s"))
          else
            end_time = Time.new(*end_time.strftime("%Y %m %d 23 59 59 %:z").split("\s"))
          end
        end
        Time.now >= begin_time && Time.now <= end_time
      else
        false
      end
    end
def in_time_window?(condition)
      if condition.has_key?(:begin) && condition.has_key?(:end)
        begin_time = Time.parse(condition[:begin])
        end_time = Time.parse(condition[:end])
        if end_time < begin_time
          if Time.now < end_time
            begin_time = Time.new(*begin_time.strftime("%Y %m %d 00 00 00 %:z").split("\s"))
          else
            end_time = Time.new(*end_time.strftime("%Y %m %d 23 59 59 %:z").split("\s"))
          end
        end
        Time.now >= begin_time && Time.now <= end_time
      else
        false
      end
    end
Determine if the current time falls within a time window. The
 provided condition must have a `:begin` and `:end` time, eg.
 "11:30:00 PM", or `false` will be returned.

 @param condition [Hash]
 @option condition [String] :begin time.
 @option condition [String] :end time.
 @return [TrueClass, FalseClass]