百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
I

icalendar

> 编程语言
开源

icalendar.rb 主仓库

1.2K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

icalendar.rb 主仓库

iCalendar -- Internet 会议日历, Ruby 样式 === ### 从 1.x 升级 ### 更好的文档还在来临,但与此同时,从 1.x 升级到 2.0 所需的变更已通过 更新 README 所需的差异 总结说明 --- iCalendar 是一个 Ruby 库,用于处理 iCalendar 文件,其格式由 RFC-5545 定义。示例 --- ### 创建日历和事件 ### ```ruby require 'icalendar'

Create a calendar with an event (standard method)

cal = Icalendar::Calendar.new cal.event do |e| e.dtstart = Icalendar::Values::Date.new('20050428') e.dtend = Icalendar::Values::Date.new('20050429') e.summary = "Meeting with the man." e.description = "Have a long lunch meeting and decide nothing..." e.ip_class = "PRIVATE" end

cal.publish ### 或者,您可以以这种方式创建事件ruby event = Icalendar::Event.new event.dtstart = DateTime.civil(2006, 6, 23, 8, 30) event.summary = "A great event!" cal.add_event(event)

event2 = cal.event # This automatically adds the event to the calendar event2.dtstart = DateTime.civil(2006, 6, 24, 8, 30) event2.summary = "Another great event!" ### 支持属性参数 …

###

有时我们并不在乎事件的开始或结束是 `Date` 对象还是 `DateTime` 对象。为此,我们可以使用 `DateOrDateTime.new(value)`。调用返回的 `DateOrDateTime` 的 `.call` 方法将立即返回底层的 `Date` 或 `DateTime` 对象。

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言