ActiveRecord::Base
# File app/models/event.rb, line 33 def self.new_from_icalendar_event(ievent) event = self.new event.starttime = ievent.dtstart event.endtime = ievent.dtend event.uid = ievent.uid event.created_at = ievent.created event.updated_at = ievent.last_modified event.description = ievent.description event.title = ievent.summary event.location = ievent.location # ("<tt>"+ievent.inspect + "<p>" + event.inspect).gsub(/#</,'#<') event end
# File app/models/event.rb, line 47 def background_color 'yellow' end
# File app/models/event.rb, line 55 def border_color 'gray' end
# File app/models/event.rb, line 65 def update_events(events, event) events.each do |e| begin st, et = e.starttime, e.endtime e.attributes = event if event_series.period.downcase == 'monthly' or event_series.period.downcase == 'yearly' nst = DateTime.parse("#{e.starttime.hour}:#{e.starttime.min}:#{e.starttime.sec}, #{e.starttime.day}-#{st.month}-#{st.year}") net = DateTime.parse("#{e.endtime.hour}:#{e.endtime.min}:#{e.endtime.sec}, #{e.endtime.day}-#{et.month}-#{et.year}") else nst = DateTime.parse("#{e.starttime.hour}:#{e.starttime.min}:#{e.starttime.sec}, #{st.day}-#{st.month}-#{st.year}") net = DateTime.parse("#{e.endtime.hour}:#{e.endtime.min}:#{e.endtime.sec}, #{et.day}-#{et.month}-#{et.year}") end #puts "#{nst} ::::::::: #{net}" rescue nst = net = nil end if nst and net # e.attributes = event e.starttime, e.endtime = nst, net e.save end end event_series.attributes = event event_series.save end
Generated with the Darkfish Rdoc Generator 2.