Skip to content

nadineprigann/vue-ics

 
 

Repository files navigation

Awesome npm version Total alerts Language grade: JavaScript Conventional Commits

vue-ics

Vue.js plugin for generating ICalendar (.ics) files.

Installation

NPM
npm install vue-ics --save
Vue
import Vue from 'vue'
import ICS from 'vue-ics'

Vue.use(ICS, { options })

Global options (optional)

{ uidDomain: string, prodId: string }

uidDomain – Your domain

prodId - Product ID

Initializing

You can add one or more events.

this.$ics.addEvent(language, subject, description, location, begin, stop, url, organizer, rrule)

Parameters

language string - Language in format en-us (default)

subject string - Subject/Title of event

description string - Description of event

location string - Location of event

begin string | Date - Beginning date of event. Date must match Date() format.

stop string | Date - Ending date of event. Date must match Date() format. Note: make sure to provide an ending date to display event correctly in a calendar

url string - URL (optional)

organizer object { name: string, email: string }

name – Name of organizer

email – E-mail of organizer

rrule object - Reccurence rule (optional)

Reccurence rule

You can add a recurrence rule for your event. Event will be repeated as often as you want.

const rrule = {
   freq: 'WEEKLY',
   until: until,
   interval: 1
}

Parameters

freq string - Required. The frequency of event recurrence. Can be DAILY, WEEKLY, MONTHLY, or YEARLY.

until string | number | Date - A date string representing the date on which to end repetition. Date must match `Date() format.

interval number - The interval of freq to recurr at. For example, if freq is WEEKLY and interval is 2, the event will repeat every 2 weeks

byday array - Which days of the week the event is to occur. An array containing any of SU, MO, TU, WE, TH, FR, SA

Remove all events from the calendar

this.$ics.removeAllEvents()

Get calendar with events as string

this.$ics.calendar()

Download calendar file

this.$ics.download(fileName)

fileName string - name of file without extension (will be *.ics)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 80.7%
  • Vue 14.2%
  • HTML 5.1%