MagicMirrorOrg / MagicMirror

MagicMirror² is an open source modular smart mirror platform. With a growing list of installable modules, the MagicMirror² allows you to convert your hallway or bathroom mirror into your personal assistant.
http://magicmirror.builders
MIT License
19.7k stars 4.2k forks source link

Calendar not working for Google calendar #36

Closed obrienk10 closed 8 years ago

obrienk10 commented 8 years ago

It looks like the latest code no longer works with Google calendar dates. It only shows recurring events now, not one-off events. I'm no javascsript expert, but I took a look, and in calendar.js the 'seconds' variable always seems to be negative. The obvious culprit is the piece of code marked "//FIXME: problems with Gmail's TimeZone", so I guess it's a known issue.

tilomitra commented 8 years ago

It is for me. Follow the steps under "See your calendar (View Only)" here: https://support.google.com/calendar/answer/37648?hl=en

obrienk10 commented 8 years ago

It used to work fine until I updated. The comment in the code even seems to indicate that it's known to be broken. Haven't tried the latest updates but will try again next week.

On 24 Dec 2015 9:55 p.m., Tilo notifications@github.com wrote:It is for me. Follow the steps under "See your calendar" here: https://support.google.com/calendar/answer/37648?hl=en

—Reply to this email directly or view it on GitHub.

kichilron commented 8 years ago

Seems to be doing the same thing for me - at the moment it's simply outputting a "500 server error" when I put in my ICAL-URL from Google.

tottidergeier commented 8 years ago

i tried the "see your calendar" and even some easy basic .ics url, but i don´t get to see a calendar. No error, just nothing. Did i miss something? I just added my own URL into config.js

scooper86 commented 8 years ago

Yes, same thing for me since latest update.

Updated config.js as per and also tried entering it straight into the PHP file however no luck.

Nexxic commented 8 years ago

Same error here. Have tried putting the .ics url both in the config.js and controllers/calendar.php.

I get the following message in the chrome debugging tool: ical_parser.js:32 GET http://192.168.1.9/controllers/calendar.php?url=https%3A%2F%2Fcalendar.google.com%2Fcalendar%2Fical%2my-private-calendar-url/basic.ics 500 (Internal Server Error)

kichilron commented 8 years ago

That is exactly the error I'm getting.

danedb commented 8 years ago

I had the same problem. There's a parenthesis missing at line 33 in controllers/functions/gzip.php

        if(stristr($h, "content-encoding") and stristr($h, "gzip") {

should be

        if(stristr($h, "content-encoding") and stristr($h, "gzip")) {

that change got it working for me...

Nexxic commented 8 years ago

That fixed it for me too. Thanks!

kichilron commented 8 years ago

Worked perfectly, thanks for investigating.

nhubbard commented 8 years ago

I'm the person that made the server part modular, but I will submit a pull request to fix it. Thanks for letting us know!

tottidergeier commented 8 years ago

Worked for me , Thanks so much!

xcellcior commented 8 years ago

It seems the calendar.php has moved to the controllers folder on https://github.com/MichMich/MagicMirror

Here is what I did, everything works except for my google calendar.

  1. Downloaded the magic mirror zip from this site

JS>CONFIG.JS

  1. added 'en' language on lines 2 and 13, 'Toronto,Canada' on line 10, and my API code for weather on line 14
  2. removed the url from the news code on line 41 so it doesn't load news
  3. swapped in my private ical google calendar url

CONTROLLERS>CALENDAR.PHP

  1. swapped in my private ical google calendar url on line 3

CONTROLLERS>FUNCTIONS>GZIP.PHP

  1. added the extra parenthesis on line 33

INDEX.PHP

  1. removed < div class="news medium">< /div> from line 20

Everything works except my calendar still wont load. I have the code on: http://www.magicmirror.xcellwebdesign.com

Any help is much appreciated :)

jimmyly89 commented 8 years ago

Adding the bracket worked for me as well! Been trying to figure this out all week!

Thanks!

nhubbard commented 8 years ago

This issue has been fixed as of acceptance of commit 91a57fdd88d331759462b8c312cd62d797fe9924. Please close this issue, @MichMich.

hrampadarath commented 8 years ago

Hi, I'm having the same issue as xcellcior. The extra parenthesis is added on line 33 and I'm using my gcal ical private address in config.js ... but no luck with the calendar showing. Any help is much appreciated.