Sub topic 8
Spotting overlaps and conflicts
This chapter assumes you can read basic Python, have a calendar table with channel, start and end dates (see the data model chapter), and know how a back-plan produces due dates. By the end you will be able to find activities that collide on the same channel before they ship.
What counts as a conflict
Two activities overlapping in time is not always a problem. A blog post and an email can run on the same day without trouble. A conflict needs two conditions:
- The activities share a channel (or the same audience on that channel).
- Their date ranges intersect.
A third check is worth adding later: the same owner assigned to two deliverables due on the same day. That is a workload clash, not a channel clash, and it is handled the same way.
| Pair | Same channel? | Dates intersect? | Conflict? |
|---|---|---|---|
| Email A, 2–15 Mar, and Email B, 10–20 Mar | Yes | Yes | Yes |
| Email A, 2–15 Mar, and Blog post, 10 Mar | No | Yes | No |
| Email A, 2–15 Mar, and Email C, 16–20 Mar | Yes | No | No |
The overlap test
Two ranges intersect when each one starts on or before the day the other ends. This single condition covers every case: partial overlap, one range inside another, and identical ranges.
The comparison uses <=, not <, because date ranges in a calendar are inclusive. An email that ends on 15 March and another that starts on 15 March both occupy that day.
A working check
The script below compares every pair once. Because it checks each activity only against the ones after it in the list, no pair is reported twice and no activity is compared with itself.
from datetime import date
activities = [
{"name": "Spring Sale email", "channel": "email", "start": date(2026, 3, 2), "end": date(2026, 3, 15)},
{"name": "Product Launch email", "channel": "email", "start": date(2026, 3, 10), "end": date(2026, 3, 20)},
{"name": "Launch blog post", "channel": "web", "start": date(2026, 3, 10), "end": date(2026, 3, 10)},
]
def overlaps(a, b):
return a["channel"] == b["channel"] and a["start"] <= b["end"] and b["start"] <= a["end"]
conflicts = [
(a["name"], b["name"])
for i, a in enumerate(activities)
for b in activities[i + 1:]
if overlaps(a, b)
]
print(conflicts) # [('Spring Sale email', 'Product Launch email')]The blog post is not flagged, because it is on a different channel even though its date falls inside both email ranges.
Common errors
- Using
<instead of<=. Two activities sharing a single boundary day slip through unreported. - Comparing text instead of dates. If dates stay as strings like
"2026-3-2", comparisons can give wrong answers. Parse them intodateobjects first. ISO strings such as2026-03-02sort correctly, but only if every row uses the same zero-padded format. - Missing end dates. A one-day activity needs
endequal tostart. A blank end date raises an error in the code above, so fill it in or default it to the start date. - Inconsistent channel names.
Email,emailande-maildo not match. Use a fixed list of allowed values and normalize case before comparing. - Treating every conflict as a defect. Some overlaps are intended, such as a teaser running during a main push. Add a field such as
allow_overlapor record a reviewed decision, so the same known pair is not raised every week.
Where to run the check
For a small calendar, a spreadsheet formula or conditional formatting that counts rows with the same channel and intersecting dates is enough. For larger ones, run a script like the one above on the exported CSV each time the calendar changes, or before the weekly review. Whichever you choose, send the result to the owner of each activity involved, not only to the calendar manager. The owners are the people who can move a date.
The pairwise comparison grows with the square of the number of activities. That is fine for hundreds of rows. If you reach tens of thousands, group the activities by channel first and compare only within each group.
Exercise
A webinar invitation email runs 4–6 June on the email channel. A newsletter on the email channel runs 6–10 June. Does the overlap test report a conflict, and which part of the condition makes the difference?
Show answer
Yes. Both are on email, the invitation starts (4 June) on or before the newsletter ends (10 June), and the newsletter starts (6 June) on or before the invitation ends (6 June). The second comparison is true only because the test uses <=. With <, the shared day of 6 June would be missed.
Exercise
Your calendar has rows with the channels "Email" and "email". What happens when you run the overlap check, and how do you fix it?
Show answer
The channel comparison treats them as different values, so overlapping email activities are not reported. Normalize the channel values, for example with lower-casing and trimming spaces, or restrict the field to a fixed list of allowed values.