Fix bug.
This commit is contained in:
parent
27b4b2aab7
commit
16edd24809
|
@ -136,15 +136,15 @@ class PHire
|
||||||
add_interval = (start_date_utc_mjd - @start_date.new_offset(0).mjd)
|
add_interval = (start_date_utc_mjd - @start_date.new_offset(0).mjd)
|
||||||
days = 7
|
days = 7
|
||||||
if add_interval < 0
|
if add_interval < 0
|
||||||
add_interval = -(-add_interval / days)
|
add_interval = 0
|
||||||
else
|
else
|
||||||
add_interval = add_interval / days
|
add_interval = add_interval / days
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
period_str = 'month'
|
period_str = 'month'
|
||||||
add_interval = ((start_date.year * 12 + start_date.month) - (@start_date.year * 12 + @start_date.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
|
end
|
||||||
add_interval = 0 if add_interval < 0
|
|
||||||
add_interval = add_interval.send(period_str)
|
add_interval = add_interval.send(period_str)
|
||||||
@start_date += add_interval
|
@start_date += add_interval
|
||||||
@end_date += add_interval
|
@end_date += add_interval
|
||||||
|
|
Loading…
Reference in New Issue