[#4517] Default the details row to All periods when it's out of the date range

This commit is contained in:
Eric Davis
2010-09-17 10:44:18 -07:00
parent 74d707a1a4
commit 19ed07b617
4 changed files with 60 additions and 10 deletions
+11
View File
@@ -47,6 +47,17 @@ class RetainerDeliverable < HourlyDeliverable
date_range.include?(date)
end
# period in the format of "%Y-%m" or "%B %Y"
def within_period_range?(period)
begin
# both valid formats work by adding a day to the end like -01
date = Date.parse(period.to_s + "-01")
within_date_range?(date)
rescue ArgumentError
return false
end
end
def months
month_acc = []