PhoenixLiveCalendar.Views.Timeline (PhoenixLiveCalendar v0.1.0)

Copy Markdown View Source

Timeline view — horizontal time axis with resources as rows.

Used for resource scheduling (rooms, people, equipment), Gantt-style project views, and multi-resource booking.

Summary

Functions

Renders a horizontal timeline with resource rows.

Functions

timeline(assigns)

Renders a horizontal timeline with resource rows.

Attributes

  • date — The date to display
  • resources — List of PhoenixLiveCalendar.Resource structs
  • events — List of PhoenixLiveCalendar.Event structs (linked to resources via resource_id)
  • min_time — Earliest visible time (default: ~T[00:00:00])
  • max_time — Latest visible time (default: ~T[23:59:59])
  • slot_duration — Slot duration in minutes (default: 60)
  • slot_width — CSS width per time slot (default: "5rem")
  • resource_width — CSS width for the resource label column (default: "12rem")
  • on_event_click — Handler for event clicks
  • on_slot_click — Handler for time slot clicks
  • translations — Translation overrides
  • time_format:h24 or :h12 (default: :h24)
  • class — Additional CSS classes
  • dir — Text direction (default: :ltr)

Slots

  • event — Custom event rendering
  • resource_label — Custom resource label. Receives the resource.

Attributes

  • date (Date) (required)
  • resources (:list) (required)
  • events (:list) - Defaults to [].
  • min_time (Time) - Defaults to ~T[00:00:00].
  • max_time (Time) - Defaults to ~T[23:59:59].
  • slot_duration (:integer) - Defaults to 60.
  • slot_width (:string) - Defaults to "5rem".
  • resource_width (:string) - Defaults to "12rem".
  • on_event_click (:any) - Defaults to nil.
  • on_slot_click (:any) - Defaults to nil.
  • translations (:map) - Defaults to %{}.
  • time_format (:atom) - Defaults to :h24.
  • class (:string) - Defaults to "".
  • dir (:atom) - Defaults to :ltr.

Slots

  • event
  • resource_label