From 014f114574b96efcb29c06f4400a3081674e4b72 Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 25 Oct 2022 10:45:59 +0800 Subject: [PATCH] Fix bug for ruby 2.7. --- app/models/event.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 3d547cf..088b040 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -219,7 +219,7 @@ class Event def self.recurring_event(start_date, end_date, preserve_hide=false) @recurring_events = self.where(:recurring => true).any_of({:recurring_end_date=>nil}, {:recurring_end_date.gte=>start_date.utc}) @recurring = [] - start_date_utc_mjd = start_date.to_datetime.utc.mjd + start_date_utc_mjd = start_date.to_datetime.new_offset(0).mjd @recurring_events.each do |re| has_recurring_end_date = re.recurring_end_date.present? data = re.as_json({}, true) @@ -259,7 +259,7 @@ class Event elsif is_year add_interval = (start_date.year - @start_date.year) else - add_interval = (start_date_utc_mjd - @start_date.utc.mjd) + add_interval = (start_date_utc_mjd - @start_date.new_offset(0).mjd) if add_interval < 0 add_interval = -(-add_interval / days) else