Getting Started

Usage

Form fields, infolist entries, and state formats.

Form field

use Asmit\FilaCalendar\Forms\Components\CalendarInput;
use Asmit\FilaCalendar\Support\CalendarMode;

CalendarInput::make('dates')
    ->label('Dates')
    ->mode(CalendarMode::Range)
    ->required();

Read-only infolist entry

use Asmit\FilaCalendar\Infolists\Components\CalendarEntry;
use Asmit\FilaCalendar\Support\CalendarMode;

CalendarEntry::make('dates')
    ->label('Saved dates')
    ->mode(CalendarMode::MultiRange)
    ->state(fn (): array => [
        ['start' => '2026-07-01', 'end' => '2026-07-10'],
    ]);

State formats

ModeStored state
single"2026-07-10"
multiple["2026-07-02", "2026-07-10"]
range{ "start": "2026-07-02", "end": "2026-07-10" }
multi-range[{ "start": "2026-07-02", "end": "2026-07-04" }, ...]

CalendarInput hydrates and dehydrates these formats automatically through CalendarState.

Interaction model

  • Selection logic runs in Alpine.js on the client.
  • Form fields bind with Livewire $entangle.
  • No server round-trip is required for each click.
  • Save/submit reads the final entangled state.

Multi-range deselect behavior

ClickResult
Start or end dayRemoves the whole range
Middle daySplits into two ranges around the removed day
Single-day rangeRemoves that day

Example: range 1–10, click day 51–4 and 6–10.