2
我添加事件的iCalendar:它可能與只有一個事件與ruby-iCalendar出口VCalendar?
require 'icalendar'
calendar = Icalendar::Calendar.new
...some properties to calendar
event = Icalendar::Event.new
...some properties to event 1
calendar.add_event(event)
event = Icalendar::Event.new
...some properties to event 2
calendar.add_event(event)
當我打電話到輸出全日曆出版(簡體)
calendar.to_ical
BEGIN:VCALENDAR
BEGIN:VEVENT
...event 1
END:VEVENT
BEGIN:VEVENT
...event 2
END:VEVENT
END:VCALENDAR
如果我把事件1只
event.to_ical
BEGIN:VEVENT
...event 1
END:VEVENT
的輸出
我想輸出只有這個事件的VCalendar(如過濾器)
BEGIN:VCALENDAR
BEGIN:VEVENT
...event 1
END:VEVENT
END:VCALENDAR
有沒有日曆對象的方法?
這不是我在找什麼,因爲有很多屬性添加到日曆(和時區)。 – Buschhardt
我提出了兩種可能的解決方案 - 一種是黑客攻擊,另一種是來自寶石的測試。哪一個不是你要找的? – hd1