【问题标题】:How do I use Icalendar::HasComponents?如何使用 Icalendar::HasComponents?
【发布时间】:2018-12-21 10:28:51
【问题描述】:

关于https://github.com/icalendar/icalendar/pull/132:鉴于我有一个

@cal = Icalendar::Calendar.new

如何使用Icalendar::HasComponents@cal 添加 X-WR-CALNAME、X-PUBLISHED-TTL 和 X-WR-CALDESC 属性?

我想在我的 .ics 文件中生成这些额外的属性,以便我可以将其添加到 Google 日历和 Outlook 并允许它们指定

  • X-WR-CALNAME - 日历名称
  • X-PUBLISHED-TTL - 刷新间隔
  • X-WR-CALDESC - 日历说明

【问题讨论】:

    标签: ruby-on-rails icalendar


    【解决方案1】:

    比我想象的要简单:

    cal = Icalendar::Calendar.new
    cal.append_custom_property("X-WR-CALNAME","My Calendar") 
    cal.append_custom_property("X-PUBLISHED-TTL","PT1H")  # every hour
    cal.append_custom_property("X-WR-CALDESC","My Desc")
    

    参考:https://github.com/icalendar/icalendar/blob/master/lib/icalendar/has_properties.rb

    【讨论】:

      猜你喜欢
      • 2012-10-31
      • 2012-10-25
      • 2021-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-08
      • 1970-01-01
      相关资源
      最近更新 更多