Interactive date picker
Month-grid date picker with keyboard navigation, min/max date constraints, locale-aware day names, and a fully-rendered ANSI view.
composer require sugarcraft/sugar-calendar
use SugarCraft\Calendar\DatePicker;
$picker = DatePicker::new(new \DateTimeImmutable('2026-01-01'));
$picker = $picker->withMinDate(new \DateTimeImmutable('2025-01-01'));
$picker = $picker->withMaxDate(new \DateTimeImmutable('2027-12-31'));
echo $picker->view(); // renders month grid
| Class | Method | Description |
|---|---|---|
| DatePicker | new(date) | Create date picker |
| DatePicker | withMinDate(date) | Set minimum selectable date |
| DatePicker | withMaxDate(date) | Set maximum selectable date |
| DatePicker | view() | Render calendar view |
| DatePicker | selected() | Get selected date |
VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.