LiveFilter.Components.DateRange (LiveFilter v0.1.8)

Copy Markdown View Source

Date range dropdown component with presets.

Renders a DaisyUI dropdown with date range presets (today, last 7 days, etc.) and a "Custom range..." option that opens the calendar picker.

Required Assigns

  • filter - The Filter struct containing value and config
  • myself - The parent LiveComponent's @myself for event targeting

Events (handled by parent)

  • select_date_preset - %{"id" => filter_id, "preset" => preset_atom}
  • show_date_calendar - %{"id" => filter_id}
  • clear_filter_value - %{"id" => filter_id}

Example

<LiveFilter.Components.DateRange.render
  filter={@filter}
  myself={@myself}
/>

Summary

Functions

Renders a date range dropdown component.

Functions

render(assigns)

Renders a date range dropdown component.

Attributes

  • filter (:map) (required) - The Filter struct.
  • myself (:any) (required) - The parent LiveComponent's @myself.