diff --git a/app/models/p_hire.rb b/app/models/p_hire.rb index 4992115..e5f2130 100644 --- a/app/models/p_hire.rb +++ b/app/models/p_hire.rb @@ -136,15 +136,15 @@ class PHire add_interval = (start_date_utc_mjd - @start_date.new_offset(0).mjd) days = 7 if add_interval < 0 - add_interval = -(-add_interval / days) + add_interval = 0 else add_interval = add_interval / days end else period_str = 'month' add_interval = ((start_date.year * 12 + start_date.month) - (@start_date.year * 12 + @start_date.month)) + add_interval = 0 if add_interval < 0 end - add_interval = 0 if add_interval < 0 add_interval = add_interval.send(period_str) @start_date += add_interval @end_date += add_interval