app/utils/maintenance.rb
def time_to(now)
    if @next_maintenance_at.nil?
      0
    else
      [@next_maintenance_at - now, 0].max
    end
  end
# Returns time (in seconds) to the next maintenance
# Return 0 if the next maintenance is in the past or not scheduled
Returns time (in seconds) to the next maintenance
Return 0 if the next maintenance is in the past or not scheduled
Returns time ( in seconds ) to the next maintenance Return 0 if the next maintenance is in the past or not scheduled
def time_to(now)
    if @next_maintenance_at.nil?
      0
    else
      [@next_maintenance_at - now, 0].max
    end
  end
def time_to ( now ) if @next_maintenance_at . nil? 0 else [ @next_maintenance_at - now , 0 ] . max end end
Returns time (in seconds) to the next maintenance
Return 0 if the next maintenance is in the past or not scheduled
Returns time ( in seconds ) to the next maintenance Return 0 if the next maintenance is in the past or not scheduled
now