我正在使用ri_cal
gem来创建ics文件。宝石的文档建议我这样做:
RiCal.Calendar do |cal|
cal.event do |event|
event.description = "MA-6 First US Manned Spaceflight"
event.dtstart = DateTime.parse("2/20/1962 14:47:39")
event.dtend = DateTime.parse("2/20/1962 19:43:02")
event.location = "Cape Canaveral"
event.add_attendee "john.glenn@nasa.gov"
event.alarm do
description "Segment 51"
end
end
end
但是当我打开在OS X日历中创建的.ics文件时,该事件没有标题。仅按描述设置了描述。
如何设置活动的标题?
答案 0 :(得分:3)
使用event.summary
:
RiCal.Calendar do |cal|
cal.event do |event|
event.summary = "The 'title' of the event"
event.description = "MA-6 First US Manned Spaceflight"
event.dtstart = DateTime.parse("2/20/1962 14:47:39")
event.dtend = DateTime.parse("2/20/1962 19:43:02")
event.location = "Cape Canaveral"
event.add_attendee "john.glenn@nasa.gov"
event.alarm do
description "Segment 51"
end
end
end
ri_cal/properties/event.rb包含您可以设置的完整属性列表。