explaingit

jkbrzt/rrule

Analysis updated 2026-07-03

3,701TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

rrule.js is a JavaScript and TypeScript library for defining and calculating repeating calendar events like 'every Monday and Friday' or 'first Tuesday of each month', following the iCalendar standard.

Mindmap

mindmap
  root((rrule.js))
    What it does
      Defines recurrence rules
      Calculates matching dates
      Parses iCalendar strings
    Key features
      RRule single pattern
      RRuleSet combining rules
      Timezone support
      Human-readable text output
    Tech stack
      TypeScript
      JavaScript
      npm or yarn
    Audience
      Developers
      Calendar app builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Define a recurring meeting rule like 'every weekday for 3 months' and generate the full list of matching dates for a calendar feature

USE CASE 2

Parse an iCalendar RRULE string from an exported .ics file and calculate the next N occurrences

USE CASE 3

Combine multiple recurring patterns and exclude specific holiday dates using RRuleSet for complex real-world scheduling

USE CASE 4

Store a recurrence rule as a compact string in a database and reload it later to calculate future dates on demand

What is it built with?

TypeScriptJavaScriptNode.js

How does it compare?

jkbrzt/rrulemeetalva/alvawebhintio/hint
Stars3,7013,7003,702
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderateeasy
Complexity2/53/53/5
Audiencedeveloperdesignerdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Date timezone handling has subtle pitfalls, the README includes specific guidance on passing dates correctly to avoid unexpected offset errors.

In plain English

rrule.js is a JavaScript and TypeScript library that handles repeating calendar events. Think of events like "every Monday and Friday for the next year" or "the first Tuesday of each month" -- this library lets you define those patterns and then ask it for the actual dates when each occurrence falls. It follows the iCalendar standard, which is the format used by calendar applications like Google Calendar, Apple Calendar, and Outlook when they share or export events. The library was originally adapted from a Python project called python-dateutil, and it brings that same date-calculation logic to the JavaScript world. You install it with npm or yarn, import a few classes into your code, and then build a rule by specifying things like frequency (daily, weekly, monthly), interval (every 2 weeks, every 3 months), which days of the week it applies to, and a start and end date. Once the rule is defined, you can ask for all matching dates, a specific range of dates, or a plain-English description like "every 5 weeks on Monday and Friday until January 31, 2013". For more complex calendaring needs, the library also provides an RRuleSet, which lets you combine multiple repeating rules together, add one-off extra dates, and exclude specific dates or entire repeating patterns from the set. This covers real-world situations where a recurring meeting might be cancelled on a holiday or supplemented with an ad-hoc session. The library includes a parser so you can take a raw iCalendar rule string (the kind you might find inside a .ics calendar file) and turn it back into a working rule object. You can also convert a rule back to that string format, which makes it easy to store rules in a database and reload them later. One area that requires care is how dates are handled. The library works internally with UTC timestamps to avoid confusion from local timezone offsets, and it includes support for named timezones like America/Denver using the browser and Node.js built-in internationalization features. The README includes detailed examples showing the correct and incorrect ways to pass in dates, which matters because JavaScript date handling can produce subtle errors when timezone offsets are applied unexpectedly.

Copy-paste prompts

Prompt 1
Show me how to use rrule.js to define a rule for 'every Monday and Friday for 6 months starting today' and get back the full list of matching dates.
Prompt 2
I have an iCalendar RRULE string from a .ics calendar export. Write TypeScript code using rrule.js to parse it and print the next 10 occurrences.
Prompt 3
How do I use rrule.js RRuleSet to define a weekly Tuesday meeting that recurs for a year but skips a specific holiday date?
Prompt 4
Show me how rrule.js handles timezone-aware recurring events so that dates are calculated correctly for users in the America/New_York timezone.
Prompt 5
I want to show users a plain-English description of a recurring rule, like 'every 2 weeks on Monday and Wednesday'. How do I get that text output from rrule.js?

Frequently asked questions

What is rrule?

rrule.js is a JavaScript and TypeScript library for defining and calculating repeating calendar events like 'every Monday and Friday' or 'first Tuesday of each month', following the iCalendar standard.

What language is rrule written in?

Mainly TypeScript. The stack also includes TypeScript, JavaScript, Node.js.

How hard is rrule to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is rrule for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub jkbrzt on gitmyhub

Verify against the repo before relying on details.