This commit is contained in:
BoHung Chiu 2022-11-24 23:20:09 +08:00
parent 27b4b2aab7
commit 16edd24809
1 changed files with 2 additions and 2 deletions

View File

@ -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