GitHub - barinbritva/add-to-calendar: Create links for adding events to calendar...
source link: https://github.com/barinbritva/add-to-calendar
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Add to Calendar
Create event links to add them to a calendar.
Supported services: Outlook
, Office365
, Google
and Yahoo
. You are also able to use ICalendar
to create downloadable links to ics
files.
Getting started
Install package:
npm install --save @barinbritva/add-to-calendar
Import entities:
import {Event, Outlook, Google, MultiGenerator} from '@barinbritva/add-to-calendar'
Create an event:
const event = new Event(
'Meet with friends',
new Date(2021, 5, 18, 15, 0),
new Date(2021, 5, 18, 17, 0),
'It\'s Bill\'s birthday today!',
'Blue Bottle Coffee, 300 S Broadway, Los Angeles'
)
Create link by link:
const outlookLink = new Outlook().createLink(event)
const googleLink = new Google().createLink(event)
console.log(outlookLink, googleLink)
Create a bunch of links:
// Create generators you are going to use
// Key names doesn't matter, it's up to you
const generators = {
outlook: new Outlook(),
office365: new Office365(),
google: new Google(),
yahoo: new Yahoo(),
ics: new ICalendar()
}
const multiGenerator = new MultiGenerator(generators);
// Object of keys/values - key => link
const linksObject = multiGenerator.createLinks(event)
// Array (tuple) of pairs key/link - [key, link][]
const array = multiGenerator.createLinks(event, true)
Wellknown issues
- Yahoo does not work properly with UTC timezone. Currently looking if there are any workarounds.
Guides
Event
API. Read how to create and manage events.Date
creation. Avoiding troubles with time zones. (Coming soon)
Feedback
Your feedback is really important for the project. Please, use contacts from my profile to send your questions, suggestions, help requests and others. Also, feel free to use issues section to report bugs and problems.
Credits
- Special thanks for information about calendar APIs to add-event-to-calendar-docs repo.
- The project is bootstrapped using init-typescript-app.
MIT, see LICENSE for the details.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK