LiveFilter.Components.Calendar (LiveFilter v0.1.8)

Copy Markdown View Source

Two-month calendar picker for custom date range selection.

Renders a DaisyUI dialog with two side-by-side calendar months, allowing selection of start and end dates for date range filters.

Required Assigns

  • filter - The Filter struct
  • myself - The parent LiveComponent's @myself for event targeting
  • current_month - The left calendar's displayed month (Date)
  • selecting_start - Whether we're selecting start date (boolean)
  • temp_start - Temporarily selected start date (Date or nil)
  • temp_end - Temporarily selected end date (Date or nil)

Events (handled by parent)

  • select_calendar_date - %{"id" => filter_id, "date" => iso_date}
  • date_prev_month - Navigate to previous month
  • date_next_month - Navigate to next month
  • date_change_month - Month dropdown change
  • date_change_year - Year dropdown change
  • cancel_date_calendar - Cancel and close

Example

<LiveFilter.Components.Calendar.render
  filter={@filter}
  myself={@myself}
  current_month={@current_month}
  selecting_start={@selecting_start}
  temp_start={@temp_start}
  temp_end={@temp_end}
/>

Summary

Functions

Renders a two-month calendar picker component.

Functions

render(assigns)

Renders a two-month calendar picker component.

Attributes

  • filter (:map) (required) - The Filter struct.
  • myself (:any) (required) - The parent LiveComponent's @myself.
  • current_month (Date) (required) - The left calendar's displayed month.
  • selecting_start (:boolean) (required) - Whether selecting start date.
  • temp_start (Date) - Temporarily selected start date. Defaults to nil.
  • temp_end (Date) - Temporarily selected end date. Defaults to nil.