Liking cljdoc? Tell your friends :D

boundary.calendar.core.conflict

Conflict detection for calendar events — pure functions, no I/O.

Detects overlapping events by expanding recurring events to individual occurrences and performing pairwise interval overlap checks.

FC/IS rule: no I/O, no logging, no exceptions.

Conflict detection for calendar events — pure functions, no I/O.

Detects overlapping events by expanding recurring events to individual
occurrences and performing pairwise interval overlap checks.

FC/IS rule: no I/O, no logging, no exceptions.
raw docstring

conflicts?clj

(conflicts? event-a event-b window-start window-end)

Return true if any occurrence of event-a overlaps any occurrence of event-b within the given time window.

Both events are expanded via recurrence/expand-event before comparison.

Args: event-a - EventData map (may be recurring) event-b - EventData map (may be recurring) window-start - java.time.Instant window-end - java.time.Instant

Returns boolean.

Return true if any occurrence of event-a overlaps any occurrence of event-b
within the given time window.

Both events are expanded via recurrence/expand-event before comparison.

Args:
  event-a      - EventData map (may be recurring)
  event-b      - EventData map (may be recurring)
  window-start - java.time.Instant
  window-end   - java.time.Instant

Returns boolean.
sourceraw docstring

find-conflictsclj

(find-conflicts events window-start window-end)

Return a vector of ConflictResult maps for all overlapping event pairs within the window.

Performs O(n²) pairwise comparison after expanding recurring events. Each pair is reported at most once (a vs b, not b vs a).

Args: events - seq of EventData maps window-start - java.time.Instant window-end - java.time.Instant

Returns a vector of maps: {:event-a EventData :event-b EventData :overlap-start Instant :overlap-end Instant}

Return a vector of ConflictResult maps for all overlapping event pairs within the window.

Performs O(n²) pairwise comparison after expanding recurring events.
Each pair is reported at most once (a vs b, not b vs a).

Args:
  events       - seq of EventData maps
  window-start - java.time.Instant
  window-end   - java.time.Instant

Returns a vector of maps:
  {:event-a       EventData
   :event-b       EventData
   :overlap-start Instant
   :overlap-end   Instant}
sourceraw docstring

overlaps?clj

(overlaps? event-a event-b)

Return true if two (expanded, non-recurring) events overlap in time.

Uses half-open interval overlap: a.start < b.end AND a.end > b.start. Events that share only a boundary (end of A = start of B) do NOT overlap.

Args: event-a - EventData map with :start and :end Instants event-b - EventData map with :start and :end Instants

Returns boolean.

Return true if two (expanded, non-recurring) events overlap in time.

Uses half-open interval overlap: a.start < b.end AND a.end > b.start.
Events that share only a boundary (end of A = start of B) do NOT overlap.

Args:
  event-a - EventData map with :start and :end Instants
  event-b - EventData map with :start and :end Instants

Returns boolean.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close