Read the statement by Michael Teeuw here.
Calendar event same start and enddate wrong (Google Calendar)
-
@sdetweil here is the requested section:
BEGIN:VEVENT DTSTART:20221121T123000Z DTSTAMP:20221120T074630Z UID:4anfmr8fbcgce4qsi1675tpgcq@google.com CREATED:20221120T074454Z LAST-MODIFIED:20221120T074454Z LOCATION: SEQUENCE:0 STATUS:CONFIRMED SUMMARY:XYZ-Robert (21.11.2022 13:30-13:30 MEZ) TRANSP:OPAQUE END:VEVENT
-
@RobertM it has no DTEND or DURATION … so the module sets End to match Start
from the spec
https://icalendar.org/iCalendar-RFC-5545/3-6-1-event-component.htmlFor cases where a “VEVENT” calendar component specifies a “DTSTART” property with a DATE value type but no “DTEND” nor “DURATION” property, the event’s duration is taken to be one day.
For cases where a “VEVENT” calendar component specifies a “DTSTART” property with a DATE-TIME value type but no “DTEND” property, the event ends on the same calendar date and time of day specified by the “DTSTART” property.
this second is the case for the event you provided
-
@sdetweil Ok, that’s true for a single event.
If I modify the event to a series event. Then the calendar module shows a wrong end date.
In the ical file, the content is different.
BEGIN:VEVENT DTSTART;TZID=Europe/Berlin:20221121T133000 DTEND;TZID=Europe/Berlin:20221121T133000 RRULE:FREQ=WEEKLY;BYDAY=MO DTSTAMP:20221120T133538Z UID:4anfmr8fbcgce4qsi1675tpgcq@google.com CREATED:20221120T074454Z DESCRIPTION: LAST-MODIFIED:20221120T133406Z LOCATION: SEQUENCE:1 STATUS:CONFIRMED SUMMARY:XYZ-series TRANSP:OPAQUE END:VEVENT
I indented the lines to read the values better
DTSTART;TZID=Europe/Berlin:20221121T133000 DTEND;TZID=Europe/Berlin:20221121T133000
-
@RobertM great, thanks…
so, I’ve found it, I don’t know why this is there or side effects…
but
edit the ~/MagicMirror/modules/default/calendar/calendarutils.js
find line 430-ish ( i added debug so the numbers may be off
endDate = moment(parseInt(startDate.format("x")) + duration, "x"); if (startDate.format("x") === endDate.format("x")) { endDate = endDate.endOf("day"); }
add the // to the endDate = line, so it looks like this
endDate = moment(parseInt(startDate.format("x")) + duration, "x"); if (startDate.format("x") === endDate.format("x")) { //endDate = endDate.endOf("day"); }
-
@sdetweil yes, thats works - after restarting node - many thanks!
Would it also be possible to only show the start of such 0 minutes events?
-
@RobertM i don’t think so… u asked to showEnd:true…
there is no conditional logic there
my settings and result
config: { showEnd:true, timeFormat:"absolute", urgency:0, getRelative:0,
-
u asked to showEnd:true…
Yes, that’s right. It looks better and is easier to capture for 0 minute events when there is no end time. For events with a time duration, I would have liked to have shown the end time.
See the following mockup above as it is now and below as I would like it to be.
-
@RobertM I know, but showEnd says format the end time after a -.
always.
is doesn’t say only if the end is different
-
@RobertM very cool!!! you submitted a PR!!