Module: Ical::Event
- Defined in:
- lib/jquery/ical/event.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #end_date ⇒ Object
- #end_date=(string_date) ⇒ Object
- #end_time ⇒ Object
- #end_time=(string_time) ⇒ Object
- #ends_at ⇒ Object
- #ends_at=(date_time) ⇒ Object
- #ical_event ⇒ Object
- #start_date ⇒ Object
- #start_date=(string_date) ⇒ Object
- #start_time ⇒ Object
- #start_time=(string_time) ⇒ Object
- #starts_at ⇒ Object
- #starts_at=(date_time) ⇒ Object
Instance Attribute Details
#all_day ⇒ Object
88 89 90 |
# File 'lib/jquery/ical/event.rb', line 88 def all_day @all_day ||= ical_event.x_properties["X-MICROSOFT-CDO-ALLDAYEVENT"][0] ? 1 : 0 end |
#description ⇒ Object
82 83 84 |
# File 'lib/jquery/ical/event.rb', line 82 def description @description ||= ical_event.description end |
#location ⇒ Object
76 77 78 |
# File 'lib/jquery/ical/event.rb', line 76 def location @location ||= ical_event.location end |
#summary ⇒ Object
70 71 72 |
# File 'lib/jquery/ical/event.rb', line 70 def summary @summary ||= ical_event.summary end |
Instance Method Details
#end_date ⇒ Object
48 49 50 |
# File 'lib/jquery/ical/event.rb', line 48 def end_date @end_date ||= I18n.l(Date.parse(ends_at.to_s)) end |
#end_date=(string_date) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/jquery/ical/event.rb', line 52 def end_date=(string_date) if parsed = DateTime.parse("#{string_date} #{end_time}") rescue nil @ends_at = parsed end @end_date = string_date end |
#end_time ⇒ Object
59 60 61 |
# File 'lib/jquery/ical/event.rb', line 59 def end_time @end_time ||= I18n.l(Time.parse(ends_at.to_s), :format => :time) end |
#end_time=(string_time) ⇒ Object
63 64 65 66 67 68 |
# File 'lib/jquery/ical/event.rb', line 63 def end_time=(string_time) if parsed = DateTime.parse("#{end_date} #{string_time}") rescue nil @ends_at = parsed end @end_time = string_time end |
#ends_at ⇒ Object
39 40 41 |
# File 'lib/jquery/ical/event.rb', line 39 def ends_at @ends_at ||= ical_event.dtend ? ical_event.dtend.to_datetime : starts_at + 60.minutes end |
#ends_at=(date_time) ⇒ Object
43 44 45 46 |
# File 'lib/jquery/ical/event.rb', line 43 def ends_at=(date_time) @end_time = @end_date = nil @ends_at = date_time end |
#ical_event ⇒ Object
4 5 6 |
# File 'lib/jquery/ical/event.rb', line 4 def ical_event @ical_event ||= RiCal.parse_string(ical_string || '').first || RiCal.Event end |
#start_date ⇒ Object
17 18 19 |
# File 'lib/jquery/ical/event.rb', line 17 def start_date @start_date ||= I18n.l(Date.parse(starts_at.to_s)) end |
#start_date=(string_date) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/jquery/ical/event.rb', line 21 def start_date=(string_date) if parsed = DateTime.parse("#{string_date} #{start_time}") rescue nil @starts_at = parsed end @start_date = string_date end |
#start_time ⇒ Object
28 29 30 |
# File 'lib/jquery/ical/event.rb', line 28 def start_time @start_time ||= I18n.l(Time.parse(starts_at.to_s), :format => :time) end |
#start_time=(string_time) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/jquery/ical/event.rb', line 32 def start_time=(string_time) if parsed = DateTime.parse("#{start_date} #{string_time}") rescue nil @starts_at = parsed end @start_time = string_time end |
#starts_at ⇒ Object
8 9 10 |
# File 'lib/jquery/ical/event.rb', line 8 def starts_at @starts_at ||= ical_event.dtstart ? ical_event.dtstart.to_datetime : DateTime.now end |
#starts_at=(date_time) ⇒ Object
12 13 14 15 |
# File 'lib/jquery/ical/event.rb', line 12 def starts_at=(date_time) @start_time = @start_date = nil @starts_at = date_time end |