CALENDAR TOOL · INTERVAL BOUNDARIES

Calendar boundaries: adjacent is not overlapping

A calendar tool checks five meeting requests against an attendee’s busy events; see how interval ends, time zones and a required gap change the answers.

Computed experiment · sixty inspection seconds

Your experiment

The attendee is busy 14:00 to 15:00, 15:00 to 16:00 and 18:00 to 19:00 UTC. The organiser asks for five slots in local time, UTC-05:00: some overlap, some only touch a busy event. Start with closed intervals, then use half-open intervals, ignore time zones and add a required gap.

Play replays the computed run over sixty inspection seconds; Next event steps, Restart rewinds, Speed changes the pace and Inspection time scrubs. Any input change recomputes the run and rewinds it without autoplay.

Event trace

    Computed data

    Final metrics

    Fixed UTC-05:00 offset with no daylight-saving change; all times are on one day. The correct answer is defined by half-open intervals after conversion to UTC, extended by the required gap when there is one. Real calendar tools also handle recurring events, all-day events, tentative status and daylight-saving transitions.

    Touching is not overlapping

    The attendee is busy 14:00 to 15:00, 15:00 to 16:00 and 18:00 to 19:00 UTC. The organiser asks, in local time UTC-05:00, for 10:00 to 10:30, 11:00 to 11:30, 08:30 to 09:00, 12:45 to 13:15 and 14:00 to 14:30. In UTC, the first and fourth overlap busy events, while the second, third and fifth only touch one. With Closed intervals the touching ends count as overlaps, so three free slots are rejected: WRONG DECISIONS, 2 of 5 correct.

    Half-open intervals

    Set Overlap test to Half-open intervals [start, end). An event that ends at 16:00 does not include 16:00, so a meeting can start exactly then: all 5 decisions are correct. Two intervals overlap when each starts before the other ends; using strict comparisons on both sides is the whole fix.

    Compare times in one zone

    Set Time zones to Compare local digits with UTC digits. The 10:00 local request is compared with 14:00 UTC events as if it were 10:00 UTC and is booked into a busy hour, the 12:45 request is booked over the 18:00 UTC event, and the free 14:00 local request is rejected because it looks like the 14:00 UTC event: 2 of 5 correct, with half-open or closed intervals alike. Store and compare instants, and convert only for display.

    A gap is a policy, not a bug

    Required gap between meetings makes touching slots unavailable on purpose. With a 5- or 15-minute gap the second, third and fifth requests are correctly rejected, and closed intervals then give the same answers as half-open ones. The difference matters: a gap is a stated rule users can see, while closed intervals reject adjacent meetings by accident.

    Reading the run and its limits

    Play, Next event, Restart, Speed and Inspection time step through every request, its UTC conversion and the decision across sixty seconds; the table compares each decision with the correct answer. The offset is fixed with no daylight-saving change and everything happens on one day; recurring and all-day events, tentative status and transitions between offsets are out of scope.

    Views are my own and do not represent any employer, past or present.

    Search