From dff1cf4b1acfa1bf1ff49fd2988db59f1c89c2c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Thu, 21 Oct 2021 13:41:51 +0800 Subject: [PATCH] fix error --- app/helpers/event_news_helper.rb | 2 +- app/models/event_news.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/event_news_helper.rb b/app/helpers/event_news_helper.rb index 962edc9..3283632 100644 --- a/app/helpers/event_news_helper.rb +++ b/app/helpers/event_news_helper.rb @@ -117,7 +117,7 @@ module EventNewsHelper links = fa["event_news_links"].map{|link| { "link_url" => link["url"], "link_title" => (link["title_translations"][locale].blank? ? link["url"] : link["title_translations"][locale]) } } rescue [] event_time_formated = a.event_time_formated s = DateTime.parse(fa["event_date"]) rescue nil - e = DateTime.parse(fa["end_date"]) rescue nil + e = DateTime.parse(fa["event_end_date"]) rescue nil if s.blank? && e.blank? event_time_formated = "" elsif s.blank? diff --git a/app/models/event_news.rb b/app/models/event_news.rb index d50ed3f..6dfcf37 100644 --- a/app/models/event_news.rb +++ b/app/models/event_news.rb @@ -106,7 +106,7 @@ class EventNews end def event_time_formated s = self.event_date - e = self.end_date + e = self.event_end_date if s.blank? && e.blank? "" elsif s.blank?