最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Recurring events on a calendar : RFC 5545 Javascript parsing- Stack Overflow

programmeradmin11浏览0评论

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?

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?

Share Improve this question edited Nov 14, 2011 at 14:17 wouter asked Nov 12, 2011 at 10:32 wouterwouter 311 silver badge4 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 4

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./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.

look into https://github./skyporter/rrule_parser.

I hope it will help you.

here is a recurrence widget for jquery, which parses/creates RFC5545 patible recurrence strings.

https://github./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/python-dateutil

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:

const rule = new RRule({
  frequency: 'YEARLY',
  byMonthOfYear: [2, 6],
  byDayOfWeek: ['SU', ['MO', 3]],
  start: new Date(2010,1,7),
}, {
  dateAdapter: StandardDateAdapter
})

let index = 0;
for (const date of rule.occurrences()) {
  date.toISOString()
  index++

  if (index > 10) break;
}

rule.occurrences({
  start: new Date(2010,5,7),
  take: 5
})
  .toArray()
  .map(date => date.toISOString())
发布评论

评论列表(0)

  1. 暂无评论