ActiveRecord::Base
Table name: calentries
id :integer not null, primary key start :datetime ende :datetime summary :string(255) typ :integer created_at :datetime not null updated_at :datetime not null
# File app/models/calentry.rb, line 72 def dauer if self.ende.nil? && self.start.nil? 0 else self.ende = self.start if self.ende.nil? (self.ende-self.start)/3600 end end
# File app/models/calentry.rb, line 80 def dauer=(dauer) self.ende=self.start+dauer.to_i.hours end
# File app/models/calentry.rb, line 46 def days_to_today if self.is_ongoing? 0 else if self.is_upcomming? (self.start.to_date - Date.today).to_i.abs elsif self.is_past? (self.ende.to_date - Date.today).to_i.abs end end end
# File app/models/calentry.rb, line 58 def get_public self.calendar=self.object.calendar unless object.nil? || object.calendar.nil? self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?) true end
# File app/models/calentry.rb, line 90 def icon_text ApplicationController.helpers.fa_icon("calendar 2x") + self.text end
# File app/models/calentry.rb, line 40 def is_ongoing? (self.start < Time.now) && (Time.now < self.ende) end
# File app/models/calentry.rb, line 43 def is_past? (Time.now > self.ende) end
# File app/models/calentry.rb, line 37 def is_upcomming? self.start > Time.now end
# File app/models/calentry.rb, line 83 def name unless self.object.nil? self.object.title else summary end end
# File app/models/calentry.rb, line 63 def s_time=(s_time) start end
# File app/models/calentry.rb, line 93 def text if self.start.nil? || self.ende.nil? "error" else 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 end
Generated with the Darkfish Rdoc Generator 2.