This commit is contained in:
BoHung Chiu 2021-12-09 11:48:22 +08:00
parent 33da76f7ae
commit 388ada1ae3
1 changed files with 3 additions and 1 deletions

View File

@ -141,7 +141,9 @@ class PHire
startt = DateTime.parse(@start_date.strftime("%Y-%m-%d " + unavailable_start_time + Time.zone.to_s)) startt = DateTime.parse(@start_date.strftime("%Y-%m-%d " + unavailable_start_time + Time.zone.to_s))
endt = DateTime.parse(@end_date.strftime("%Y-%m-%d " + unavailable_end_time + Time.zone.to_s)) endt = DateTime.parse(@end_date.strftime("%Y-%m-%d " + unavailable_end_time + Time.zone.to_s))
if !((startt..endt) & (@start_date..@end_date)).blank? if !((startt..endt) & (@start_date..@end_date)).blank?
break if (@start_date + interval) > new_end_date @start_date += interval
@end_date += interval
datet += interval if datet
next next
end end
end end