From 16edd2480989421711da466a504d44c5bb6f9175 Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 24 Nov 2022 23:20:09 +0800 Subject: [PATCH] Fix bug. --- app/models/p_hire.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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