https://github.com/waratuman/rfc5545-rrule
RFC5545 RRule library for JavaScript
https://github.com/waratuman/rfc5545-rrule
ical javascript rfc5545 rrule typescript
Last synced: 2 months ago
JSON representation
RFC5545 RRule library for JavaScript
- Host: GitHub
- URL: https://github.com/waratuman/rfc5545-rrule
- Owner: waratuman
- License: isc
- Created: 2017-02-06T06:32:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T14:44:39.000Z (over 3 years ago)
- Last Synced: 2025-04-11T06:14:54.166Z (2 months ago)
- Topics: ical, javascript, rfc5545, rrule, typescript
- Language: TypeScript
- Size: 64.5 KB
- Stars: 24
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RFC5545 RRule
RFC5545 RRule library for JavaScript.
## Installation
Using [NPM](https://www.npmjs.com/):
```bash
npm install rfc5545-rrule
```Using [Yarn](https://yarnpkg.com/):
```bash
yarn add rfc5545-rrule
```## Usage
### Node.js
```javascript
let { RRule, Day } = require("rfc5545-rrule");let rrule = RRule.fromString("RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8");
console.log(rrule);
// RRule {
// interval: 4,
// weekStart: 1,
// frequency: 'yearly',
// byMonth: [ 10 ],
// byDay: [ Day { value: 2, nth: undefined } ],
// byMonthDay: [ 2, 3, 4, 5, 6, 7, 8 ]
// }// A recurrence that repeats every Sunday of the week.
rrule = new RRule({ frequency: "weekly", byDay: [ new Day(0) ] });
rrule.toString(); // RRULE:FREQ=WEEKLY;BYDAY=SU
```### TypeScript
```typescript
import { RRule } = from "rfc5545-rrule";let rrule = RRule.fromString("RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8");
```
## License
[ICS](https://github.com/waratuman/rfc5545-rrule/blob/master/LICENSE)## Development
### Compiling the grammar
```bash
npx nearleyc ./src/grammar.ne -o ./src/grammar.ts
```Update `./src/grammar.ts` to export `ParserRules` and `ParserStart`. Also, remove
the wrapping function and export at the bottom of the file.```bash
npm run compile
````