PhoenixLiveCalendar.Views.MonthGrid (PhoenixLiveCalendar v0.1.0)

Copy Markdown View Source

Month grid view — the traditional calendar layout with 6 rows of 7 days.

Multi-day events render as full-width bars inside each day cell, occupying consistent slot positions across all days they span. This creates a visual continuous line without any absolute positioning — the grid handles sizing and wrapping naturally.

Day markers (holidays, notices) tint the cell background with a corner label.

Summary

Functions

Renders a month grid — six rows of seven days.

Functions

month_grid(assigns)

Renders a month grid — six rows of seven days.

Multi-day events render as full-width bars that keep a consistent slot row across every day they span; day markers tint the matching cells.

Attributes

  • date — any date within the month to render
  • events — list of PhoenixLiveCalendar.Event structs
  • day_markers — list of PhoenixLiveCalendar.DayMarker structs
  • selected_date / today — dates to highlight
  • week_start1 (Monday, default) … 7 (Sunday)
  • max_events — single-day events shown per cell before a "+N more" link (default 3)
  • max_multiday — cap on multi-day bar rows per cell (default: no cap)
  • expand_cells — grow cells to fit all bars instead of clipping
  • show_week_numbers / show_weekends / fixed_weeks — layout toggles
  • on_date_click / on_event_click / on_more_click — JS commands or event names
  • translations / time_format / dir / class — presentation

Attributes

  • date (Date) (required)
  • events (:list) - Defaults to [].
  • day_markers (:list) - Defaults to [].
  • selected_date (Date) - Defaults to nil.
  • today (Date) - Defaults to nil.
  • week_start (:integer) - Defaults to 1.
  • max_events (:integer) - Defaults to 3.
  • max_multiday (:integer) - Max multi-day bar rows to show per day cell; bars beyond it fold into the day's "+N more" link. nil (default) shows every bar (no cap). Defaults to nil.
  • expand_cells (:boolean) - When true, day cells grow vertically to fit all their bars (min-height, no clipping) instead of a fixed height that clips overflow. Useful when every event must stay visible (e.g. project bars). Defaults to false.
  • show_week_numbers (:boolean) - Defaults to false.
  • show_weekends (:boolean) - Defaults to true.
  • fixed_weeks (:boolean) - Defaults to true.
  • on_date_click (:any) - Defaults to nil.
  • on_event_click (:any) - Defaults to nil.
  • on_more_click (:any) - Defaults to nil.
  • translations (:map) - Defaults to %{}.
  • time_format (:atom) - Defaults to :h24.
  • marker_ticker (:boolean) - Defaults to true.
  • marker_ticker_interval (:integer) - Defaults to 3000.
  • class (:string) - Defaults to "".
  • dir (:atom) - Defaults to :ltr.

Slots

  • day_cell
  • event