Typescript iCal creation and manipulation toolset 🪄📆
Warning This library is currently in alpha and the API may change significantly between versions.
Install from npm
yarn add ayecal
import ayecal from 'ayecal'
// Create a calendar
// Provide a name and a "scope" which distinguishes events from other calendars
const myCalendar = ayecal({
name: 'My Calendar',
scope: 'custom-calendar.net',
})
.setTimezone('Australia/Melbourne')
.addEvent({
summary: 'Jacob\'s 22nd Birthday Party',
location: 'My apartment',
description: 'Hey everyone! Come to my party :)',
uid: 5678, // from your API
startTime: new Date(),
endTime: new Date(),
})
// Convert to an ICS string
const myICS = myCalendar.toICS()
import ayecal from 'ayecal'
// Create an event
const myEvent = ayecal.event({
summary: 'Company Mixer',
location: '32 Downtown St, Melbourne Australia',
description: 'Hey everyone! Come to my party :)',
uid: 5678, // from your API
startTime: new Date(),
endTime: new Date(),
})
// Convert to an ICS string
const eventICS = myEvent.toICS()
// Add to an existing calendar
const myCalendar = ayecal()
myCalendar.addEvent(myEvent)
Issues and pull requests are welcomed.
Run yarn
to install dependencies then yarn watch
to build on file changes.
Run yarn test
before committing to run the test cases.
This library uses changesets, if the changes you've made would constitute a version bump, run yarn changeset
and follow the prompts to document the changes you've made. Changesets are consumed on releases, and used to generate a changelog and bump version number.
- Recurring Event Support
- To Do Support
- ICS Parsing
- Non-mutable objects?
- Support all fields from the iCal spec
Created by Stevent and licensed under MIT