Open hactar opened 1 month ago
Hey there, @hactar! I'm a bot here to help you with bugs, questions, and becoming a contributor. I'll do my best to assist you while waiting for a human maintainer.
The issue with all-day events created using the macOS Calendar app not blocking the calendar in cal.com is known and has been reported by multiple users. There are specific considerations and potential issues related to timezone handling for all-day events, especially when the dtstart
timezone is in UTC or when only tzid
is available without vtimezone
[1].
To address this, you might want to check the following:
Timezone Handling: Ensure that the timezone information is correctly set and recognized. The code fetches the user's timezone from the database primarily for all-day events without any timezone information. If the dtstart
timezone is in UTC, it is represented by "Z", but this is not recognized as UTC in ICAL.js.
Adding VTIMEZONE Component: When only tzid
is available without vtimezone
, the code needs to add vtimezone
explicitly to handle timezone differences. This involves setting the timezone offset and providing a standard dtstart
.
Here is a relevant code snippet for adding the vtimezone
component:
if (!vcalendar.getFirstSubcomponent("vtimezone")) {
const timezoneToUse = tzid || userTimeZone;
if (timezoneToUse) {
try {
const timezoneComp = new ICAL.Component("vtimezone");
timezoneComp.addPropertyWithValue("tzid", timezoneToUse);
const standard = new ICAL.Component("standard");
const tzoffsetfrom = dayjs(event.startDate.toJSDate()).tz(timezoneToUse).format("Z");
const tzoffsetto = dayjs(event.endDate.toJSDate()).tz(timezoneToUse).format("Z");
standard.addPropertyWithValue("tzoffsetfrom", tzoffsetfrom);
standard.addPropertyWithValue("tzoffsetto", tzoffsetto);
standard.addPropertyWithValue("dtstart", "1601-01-01T00:00:00");
timezoneComp.addSubcomponent(standard);
vcalendar.addSubcomponent(timezoneComp);
} catch (e) {
console.log("error in adding vtimezone", e);
}
} else {
console.error("No timezone found");
}
}
These steps should help in diagnosing and potentially resolving the issue with all-day events created via the macOS Calendar app not blocking the calendar in cal.com [1].
To continue the conversation, mention @dosu.
Attached is a screenshot from my native macos app - note that the link is principally working: cal.com created an event for me and it appeared in iCloud.
I seem to be experiencing the opposite issue to what @hactar described. Whereas he reported that all-day events marked as 'busy' in their MacOS app were showing up as available in cal.com, in my case, all-day events marked as 'free' in my Google sub-calendar are being incorrectly blocked off in cal.com instead of appearing as available.
It looks like thie ticket https://github.com/calcom/cal.com/issues/6292 is not resolved. I too have a fully working cal.com set up with Apple iCloud calendar, yet all day events that I create using the MacOS app do not "block" the calendar, as described in the linked issue.
It also looks like a different user has narrowed the problem down to events created via the MacOS native app (see most recent comments in linked ticket.
CAL-3836