randomBrainstormer/MMM-GoogleCalendar

All Day Events Broadcast with Incorrect Time?

nickloudermilk opened this issue · 3 comments

I'm using MMM-CalendarExt3 to display my events from MMM-GoogleCalendar in a month-view. Partial-day events have the correct time, but all day events appear to start at 7 PM (5 hours before their intended start time of midnight). I'm in a time zone that is UTC-5 if that matters.
Screenshot

I have the same problem. Mine show as starting at 6 PM the day before the event. I am UTC-6.

I use MMM-CalendarExt3 that show module calender.
and add to CX3_shared.mjs:
let offset = new Date().getTimezoneOffset() * 60 * 1000 + 60 * 60 * 1000
let startTime = document.createElement('div')
let st = new Date(+event.startDate-offset)
startTime.classList.add('time', 'startTime', (st.getDate() === tm.getDate()) ? 'inDay' : 'notInDay')
startTime.innerHTML = new Intl.DateTimeFormat(locale, eventTimeOptions).formatToParts(st).reduce((prev, cur, curIndex, arr) => {
prev = prev + <span class="eventTimeParts ${cur.type} seq_${curIndex}">${cur.value}</span>
return prev
}, '')
headline.appendChild(startTime)

let endTime = document.createElement('div')
let et = new Date(+event.endDate-offset)

Update: Upon rechecking, I saw that my region zone is not set correctly on the Raspberry. (the time clock whas wrong)
After the update it I deleted the offset.