AutoCommit Mon Jun 8 17:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-06-08 17:03:02 +02:00
parent dc318e0efb
commit 45b5798e7d
14 changed files with 96 additions and 127 deletions

View File

@@ -89,12 +89,16 @@ end
ApplicationController.helpers.fa_icon("calendar 2x") + self.text
end
def text
if (self.start.to_date - self.ende.to_date) < 1.day
format=:timeonly
if self.start.nil? || self.ende.nil?
"error"
else
format =:default
if (self.start.to_date - self.ende.to_date) < 1.day
format=:timeonly
else
format =:default
end
I18n.l(self.start) +" "+ I18n.t("cal.bis")+" "+ I18n.l(self.ende, :format=>format)
end
I18n.l(self.start) +" "+ I18n.t("cal.bis")+" "+ I18n.l(self.ende, :format=>format)
end
scope :public, -> { where(:public => :true) }
# scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 28.days.from_now) }