2.0.3 • Published 5 years ago

addcal v2.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

AddCal Build Status

Open-source web application utility for adding calendar events via certain platform API's (Google, etc.)

Current API Support

Pre-requisites

  • Platform-specific API access grants from consuming web apps, specified through configuration options (see below).

Implementation Example

An example for Typescript...

import AddCal, {EventParams, generators} from 'addcal';

export class AppComponent {
  private addCal:AddCal;

  public constructor(){
    this.addCal = new AddCal({
      google: {
        apiKey: '<YOUR_API_KEY>',
        clientKey: '<YOUR_CLIENT_ID>'
      }
    });
  }

  /**
   * Add event to an api service (google, etc.)
   */
  public click_addEvent(eventData, service /* 'google' */){
    const params = new EventParams({
    	summary: eventData.summary, // 'Event Summary'
		description: eventData.description, // 'Event description.'
		start: eventData.start, // new Date()
		duration: eventDate.duration, // 60 minutes
		url: eventData.url // 'http://www.google.com'
    });
  
    this.addCal.addEvent(service, params)
      .then(() => {
        console.log('The reminder was added!');
      })
      .catch((err) => {
        console.log('There was a problem adding the reminder');
      })
    ;
  }
  
  /**
   * Download an .ics file
   */
  public click_downloadEvent(eventData, type /* 'ical' */){
    const params = new EventParams({
    	summary: eventData.summary, // 'Event Summary'
		description: eventData.description, // 'Event description.'
		start: eventData.start, // new Date()
		duration: eventDate.duration, // 60 minutes
		url: eventData.url // 'http://www.google.com'
    });
  
    this.addCal.download(type, params); // Or use `generators.ICALENDAR` for 'type' param
  }
}
2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago