UNPKG

@barinbritva/add-to-calendar

Version:

[![Dependencies counter](https://img.shields.io/badge/dependencies-none-green?style=flat-square)](https://github.com/barinbritva/add-to-calendar/blob/master/package.json) [![License](https://img.shields.io/npm/l/micromatch?style=flat-square)](https://gith

21 lines (20 loc) 766 B
import { StringHelper } from '../Utils/StringHelper'; import { UrlGenerator } from './UrlGenerator'; export class Google extends UrlGenerator { constructor() { super(...arguments); this.urlBase = 'https://calendar.google.com/calendar/render'; } convertEventToQueryObject(event) { return { action: 'TEMPLATE', text: event.title, dates: StringHelper.clearPunctuation(event.getStartDateAsString()) + '/' + StringHelper.clearPunctuation(event.getEndDateAsString()), details: event.description, location: event.locationName, add: event.hasAttendees() ? this.convertAttendeesToString(event.attendees) : undefined }; } }