Merge pull request #56 from sschneid/summary_default_from

Use today as a default 'from' value
This commit is contained in:
Colin 2015-02-25 15:51:21 -08:00
commit 251ae36aa7

View file

@ -268,8 +268,10 @@ module Vmpooler
halt 400, 'Invalid "to" date format, must match YYYY-MM-DD' halt 400, 'Invalid "to" date format, must match YYYY-MM-DD'
end end
# We do need a from date, however. # It is also ok if from_param is nil, we will assume this also means 'today'
if from_param.nil? or !validate_date_str(from_param.to_s) if from_param.nil?
from_param = Date.today.to_s
elsif !validate_date_str(from_param.to_s)
halt 400, 'Invalid "from" date format, must match YYYY-MM-DD' halt 400, 'Invalid "from" date format, must match YYYY-MM-DD'
end end