From ba79afadd0ec10e36ae6cdf1b314001d05e430d2 Mon Sep 17 00:00:00 2001 From: bohung Date: Wed, 3 Aug 2022 16:29:49 +0800 Subject: [PATCH] Fix bug. --- app/models/event.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 9bf5f81..3d547cf 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -170,7 +170,8 @@ class Event :recurring => self.recurring, :calendar => self.calendar_type_id.to_s, :color => (self.calendar_type.color rescue nil), - :diff_day => self.all_day + :diff_day => self.all_day, + :url_linked => self.url } end else @@ -195,6 +196,7 @@ class Event :diff_day => self.all_day, :edit_url => Rails.application.routes.url_helpers.edit_admin_calendar_path(:locale=>I18n.locale, :id=>self.id), :delete_url => Rails.application.routes.url_helpers.admin_calendar_path(:locale=>I18n.locale, :id=>self.id), + :url_linked => self.url, :hide => need_hide, :org_color => org_color, :hide_color => "#c0c0c0" @@ -277,7 +279,7 @@ class Event add_interval -= @start_date.wday.day need_check_start = true end - start_date = [start_date, @start_date].max + tmp_start_date = [start_date, @start_date].max @start_date += add_interval @end_date += add_interval new_end_date = has_recurring_end_date ? [re.recurring_end_date,end_date].min : end_date @@ -310,7 +312,7 @@ class Event end weekdays.each do |w| new_start = (@start_date + w.day) - if need_check_start && new_start < start_date + if need_check_start && new_start < tmp_start_date next end if new_start != org_start