jakefrk / icaltogooglecal

Google Script for fetching ical by URL and posting events to Google Calendar
0 stars 0 forks source link

ICAL.js in google apps script #1

Open echoix opened 6 years ago

echoix commented 6 years ago

How did you get to have ical.js being functionnal in Google Apps Script? I downloaded a copy of ical.js and copied its content into a new script file in my GAS project, named ICAL.gs, but when saving, an error appears. It mentions that the property "parent" is already defined in the object's literal on line 2813. I can't find a workaround yet.

echoix commented 6 years ago

I think I found a workaround, but I’m not finished using it, so no way to know if errors exist. Since Google Apps Script use JavaScript 1.6 (equivalent to ES3) and some of JavaScript 1.7 and up, I thought of using Browserify/Babel to rewrite for older JavaScript browsers, but didn’t work. I thought of using Google’s Closure compiler to maybe get rid of the syntax with errors. It didn’t. But what seems to work is to add Mozilla’s shim.js to that script in the Closure compiler to bring support for EcmaScript 3 from EcmaScript 5 or 6. But I still need to find out what really worked, the shim or the Closure compiler or Browserify or Babel, or any combination of them.

derekantrican commented 5 years ago

Any update on this @echoix ? I'm stuck in the same situation

@jakefrn could you share specifically which part you commented out?

echoix commented 5 years ago

I didn't continue with the project, so no update... sorry.