[#4420] Make #months handle more edge cases.

This commit is contained in:
Eric Davis
2010-08-30 09:50:24 -07:00
parent 9a4b4f2b43
commit 40d4029cd1
2 changed files with 35 additions and 2 deletions
+4 -2
View File
@@ -24,17 +24,19 @@ class RetainerDeliverable < HourlyDeliverable
end
def beginning_date
start_date && start_date.beginning_of_month
start_date && start_date.beginning_of_month.to_date
end
def ending_date
end_date && end_date.end_of_month
end_date && end_date.end_of_month.to_date
end
def months
month_acc = []
current_date = beginning_date
return [] if current_date.nil? || ending_date.nil?
while current_date < ending_date do
month_acc << current_date
current_date = current_date.advance(:months => 1)