All Day Events Broadcast with Incorrect Time?
nickloudermilk opened this issue · 3 comments
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.