PHP code example of noraitec / filament-flatpickr-plugin
1. Go to this page and download the library: Download noraitec/filament-flatpickr-plugin library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
noraitec / filament-flatpickr-plugin example snippets
use Noraitec\FilamentFlatpickrPlugin\Components\Flatpickr;
Flatpickr::make('inicio')
->label('Fecha y hora de inicio')
->enableTime()
->enableSeconds()
->allowInput()
->minDate('today')
->maxDate('2025-12-31')
->defaultDate(now()->format('Y-m-d'))
->altInput()
->altFormat('d/m/Y')
->inline(false)
->mode('range')
->weekNumbers()
->disableMobile()
->locale('es')
->timezone('Europe/Madrid')
//También se pueden configurar funciones JS:
Flatpickr::make('fecha')
->onChange('function(selectedDates, dateStr, instance) { console.log(dateStr); }');
bash
php artisan vendor:publish --tag=filament-flatpickr-plugin