app/models/studentdb/course.rb
def meets_at_time?(start_t, end_t = nil)
    start_time = Time.parse(sdb_course_convert_time(starting_time.clone).to_s.insert(-3, ":"))
    end_time = Time.parse(sdb_course_convert_time(ending_time.clone).to_s.insert(-3, ":"))
    if end_t
      user_range = (parse_to_time(start_t).to_i..parse_to_time(end_t).to_i)
      (start_time.to_i..end_time.to_i).step(60) do |m|
        return true if user_range.include?(m)
      end
      false
    else
      (start_time..end_time).include?(parse_to_time(start_t))
    end
  end
# Returns true if this class is in session during the time-of-day specified. You can pass an actual Time object (only
# the time portion will be used in the comparison) or a string like "1:30 pm" or "13:30" or "1330".
# Pass a second parameter as an ending_time to evaluate a range of time (optional).
Returns true if this class is in session during the time-of-day specified.
Returns true if this class is in session during the time - of - day specified .
def meets_at_time?(start_t, end_t = nil)
    start_time = Time.parse(sdb_course_convert_time(starting_time.clone).to_s.insert(-3, ":"))
    end_time = Time.parse(sdb_course_convert_time(ending_time.clone).to_s.insert(-3, ":"))
    if end_t
      user_range = (parse_to_time(start_t).to_i..parse_to_time(end_t).to_i)
      (start_time.to_i..end_time.to_i).step(60) do |m|
        return true if user_range.include?(m)
      end
      false
    else
      (start_time..end_time).include?(parse_to_time(start_t))
    end
  end
def meets_at_time? ( start_t , end_t = nil ) start_time = Time . parse ( sdb_course_convert_time ( starting_time . clone ) . to_s . insert ( - 3 , ":" ) ) end_time = Time . parse ( sdb_course_convert_time ( ending_time . clone ) . to_s . insert ( - 3 , ":" ) ) if end_t user_range = ( parse_to_time ( start_t ) . to_i .. parse_to_time ( end_t ) . to_i ) ( start_time . to_i .. end_time . to_i ) . step ( 60 ) do | m | return true if user_range . include? ( m ) end false else ( start_time .. end_time ) . include? ( parse_to_time ( start_t ) ) end end
Returns true if this class is in session during the time-of-day specified.
Returns true if this class is in session during the time - of - day specified .
start_t
end_t