From 69e269cf592e3b7ea22327eb61bdf653c2194b31 Mon Sep 17 00:00:00 2001 From: bohung Date: Fri, 25 Sep 2020 21:43:13 +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 aa6291e..19ffcfc 100644 --- a/app/models/p_hire.rb +++ b/app/models/p_hire.rb @@ -66,8 +66,8 @@ class PHire unavailable_end_date = @property.end_date unavailable_start_time = @property.start_time.to_s unavailable_end_time = @property.end_time.to_s - unavailable_start_date = DateTime.parse(unavailable_start_date.strftime("%Y-%m-%d " + unavailable_start_time.to_s + unavailable_start_date.zone)) - unavailable_end_date = DateTime.parse(unavailable_end_date.strftime("%Y-%m-%d " + unavailable_end_time.to_s + unavailable_end_date.zone)) + unavailable_start_date = DateTime.parse(unavailable_start_date.strftime("%Y-%m-%d " + unavailable_start_time.to_s + Time.zone.to_s)) rescue nil + unavailable_end_date = DateTime.parse(unavailable_end_date.strftime("%Y-%m-%d " + unavailable_end_time.to_s + Time.zone.to_s)) rescue nil unavailable_weekdays = @property.weekdays.collect{|w| w.to_i} @recurring_events = self.where(:property_id => property_id, :recurring_end_date.gte => start_date) @recurring_events.each do |re|