Fix bug for ruby 2.7.
This commit is contained in:
parent
329e9631b9
commit
014f114574
|
@ -219,7 +219,7 @@ class Event
|
||||||
def self.recurring_event(start_date, end_date, preserve_hide=false)
|
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_events = self.where(:recurring => true).any_of({:recurring_end_date=>nil}, {:recurring_end_date.gte=>start_date.utc})
|
||||||
@recurring = []
|
@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|
|
@recurring_events.each do |re|
|
||||||
has_recurring_end_date = re.recurring_end_date.present?
|
has_recurring_end_date = re.recurring_end_date.present?
|
||||||
data = re.as_json({}, true)
|
data = re.as_json({}, true)
|
||||||
|
@ -259,7 +259,7 @@ class Event
|
||||||
elsif is_year
|
elsif is_year
|
||||||
add_interval = (start_date.year - @start_date.year)
|
add_interval = (start_date.year - @start_date.year)
|
||||||
else
|
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
|
if add_interval < 0
|
||||||
add_interval = -(-add_interval / days)
|
add_interval = -(-add_interval / days)
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue