Vue.js plugin for generating ICalendar (.ics) files.
npm install vue-ics --save
import Vue from 'vue'
import ICS from 'vue-ics'
Vue.use(ICS, { options })
{ uidDomain
: string, prodId
: string }
uidDomain
– Your domain
prodId
- Product ID
You can add one or more events.
this.$ics.addEvent(language, subject, description, location, begin, stop, url, organizer, rrule)
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)
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
}
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
this.$ics.removeAllEvents()
this.$ics.calendar()
this.$ics.download(fileName)
fileName
string - name of file without extension (will be *.ics)