我需要将重复发生的事件集成到完整日历的改编版本中,该版本添加了允许离线事件浏览的 JavaScript 模块。
我正在寻找一个可以根据 RFC 5545 解析重复事件的 javascript 库。
我需要能够列出 2 个日期(开始日期和结束日期)之间发生的所有重复事件,使用 RRULE 和 EXDATE 并解释每日、每周,每月和每年的复发。
我花了几个小时寻找一些没有 aval 的东西,我不想重新发明轮子......任何人都可以为我指出现有 javascript 解析器的正确方向吗?
I need to integrate recurring events into an adapted version of full-calendar that has an added javascript module which allows offline event browsing.
I'm looking for a javascript library that can parse recurring events according to RFC 5545.
I need to be able to list all recurring events that occur between 2 dates (start date and end date), using RRULE and EXDATE and interpreting daily, weekly, monthly and yearly recurrences.
I've spent hours searching for something to no aval, and I don't want to reinvent the wheel....Can anyone please point me in the right direction for an existing javascript parser?
发布评论
评论(4)
我检查了 skyporters rrule_parser 并发现它不支持所有规则(特别是它不能正确执行 BYDAY)。我找到了一个很棒的替代方案:
https://github.com/jakubroztocil/rrule
他们正在积极支持这个库,并有一个很棒的演示网站,显示了所有功能。您可以从 5545 格式或纯文本(使用 nlp 扩展)进行解析。它功能丰富,据我所知,功能齐全。
I checked into skyporters rrule_parser and found that it doesn't support all of the rules (particularly, it won't do BYDAY properly). I found a fantastic alternative:
https://github.com/jakubroztocil/rrule
They are actively supporting this library and have a great demo website that shows all of the functionality. You can parse from either 5545 format or plain text (using the nlp extension). It is feature packed and, as far as I can tell, fully functioning.
查看https://github.com/skyporter/rrule_parser。
我希望它能帮助你。
look into https://github.com/skyporter/rrule_parser.
I hope it will help you.
这是 jquery 的重复小部件,它解析/创建 RFC5545 兼容的重复字符串。
https://github.com/collective/jquery.recurrenceinput.js
它不会扩展不过,将重复规则转化为发生日期。但它包含一个 python 服务器,可以使用 python-dateutil 为您完成此操作: http://labix.org/ python-dateutil
here is a recurrence widget for jquery, which parses/creates RFC5545 compatible recurrence strings.
https://github.com/collective/jquery.recurrenceinput.js
it does not expanding of a recurrence rule into occurrence dates, though. but it includes a python server, which can do it for you, using python-dateutil: http://labix.org/python-dateutil
我自己需要这个功能以及时区支持,所以我制作了一个 typescript/javascript 库: rSchedule 。
目前支持除 BYSETPOS、BYWEEKNO 和 BYYEARDAY 之外的所有 ICAL 重复规则。支持与 ICAL 格式之间的序列化以及大量额外的内容。
例子:
I needed this functionality myself, along with time zone support, so I made a typescript/javascript library: rSchedule.
Currently supports all ICAL recurrence rules except BYSETPOS, BYWEEKNO, and BYYEARDAY. Supports serialization to/from ICAL format along with a ton of extra stuff.
Example: