Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error #1

Open
patrickmac110 opened this issue Mar 30, 2021 · 2 comments
Open

Error #1

patrickmac110 opened this issue Mar 30, 2021 · 2 comments

Comments

@patrickmac110
Copy link

This is from my debug log:
TypeError: Cannot read property 'getEventsForDay' of undefined syncToHabbitica @ Code.gs:10

I have CALENDAR_NAME defined properly, I believe, I even tried different names. Any idea why this isn't working?

@sakkon227
Copy link

Me too!!

@sakkon227
Copy link

This is from my debug log:
TypeError: Cannot read property 'getEventsForDay' of undefined syncToHabbitica @ Code.gs:10

I have CALENDAR_NAME defined properly, I believe, I even tried different names. Any idea why this isn't working?

Okay so instead of having

// const today = new Date();
// const agenda = CalendarApp.getCalendarsByName(CALENDAR_NAME)[0];
// const events = agenda.getEventsForDay(today);

replace it with
var today = new Date();
var events = CalendarApp.getDefaultCalendar().getEventsForDay(today);

looks like the GetCalendarsByName function doesn't exist :)
lmk if this helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants