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

Add properties for being compatible with default calendar module broadcasting #46

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions MMM-GoogleCalendar.js
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check this.

Copy link
Contributor Author

@eouia eouia Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR, I think you can fix this issue by yourself. I don't care if the properties are supported; my PR is accepted or not. :D

Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,14 @@ Module.register("MMM-GoogleCalendar", {
event.calendarName = this.calendarNameForCalendar(calendarID);
event.color = this.colorForCalendar(calendarID);
delete event.calendarID;

// Make a broadcasting event to be compatible with the default calendar module.
event.title = event.summary;
event.fullDayEvent = (event.start?.date && event.end?.date) ? true : false;
let startDate = event.start?.date ?? event.start?.dateTime;
let endDate = event.end?.date ?? event.end?.dateTime;
event.startDate = (startDate) ? moment(startDate).valueOf() : null;
event.endDate = (endDate) ? moment(endDate).valueOf() : null;
eventList.push(event);
}
}
Expand Down