Merge pull request #6 from dkaushik95/master

Fixed Google Calendar Bad request
This commit is contained in:
Jason Salzman
2017-03-08 15:25:30 -08:00
committed by GitHub
+6 -4
View File
@@ -30,14 +30,16 @@ export default class helpers {
switch (type) {
case 'google':
calendarUrl = 'https://www.google.com/calendar/event';
// This is all I changed, there were 2 problems,
// first, the root URL of Google calendar changed, and second,
// somehow the order of the params creates a bad request so I fixed that too
calendarUrl = 'https://calendar.google.com/calendar/render';
calendarUrl += '?action=TEMPLATE';
calendarUrl += '&text=' + event.title;
calendarUrl += '&dates=' + this.formatTime(event.startTime);
calendarUrl += '/' + this.formatTime(event.endTime);
calendarUrl += '&details=' + event.description;
calendarUrl += '&location=' + encodeURIComponent(event.location);
calendarUrl += '&sprop=&sprop=name:Alpha';
calendarUrl += '&text=' + encodeURIComponent(event.title);
calendarUrl += '&details=' + encodeURIComponent(event.description);
break;
case 'yahoo':