Framework

KLCalendarLanes

KLCalendarLanes assigns deterministic lanes to multi-day all-day events in a calendar grid. It solves the part of a calendar layout that is easy to get wrong when a range overlaps a single-day event or another range. The package only calculates placement. It does not render dates, colors, labels, or event cells.

Overview

let layout = KLCalendarLaneEngine().layout(
    events: [
        KLCalendarLaneEvent(
            id: "holiday",
            startDate: startDate,
            endDate: endDate,
            sortKey: "holiday"
        )
    ],
    in: week,
    configuration: KLCalendarLaneConfiguration(
        calendar: calendar,
        maximumLaneCount: 2,
        endBoundary: .inclusive
    )
)
let reservedRows = layout.coveredLaneCount(on: date)

Guides

KLCalendarLanes · Swift Package documentation