PHP code example of harvirsidhu / filament-timepicker
1. Go to this page and download the library: Download harvirsidhu/filament-timepicker 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/ */
harvirsidhu / filament-timepicker example snippets
use Harvirsidhu\FilamentTimepicker\SmartTimePicker;
SmartTimePicker::make('start_time')
->interval(15);
use Harvirsidhu\FilamentTimepicker\SmartTimePicker;
SmartTimePicker::make('start_time')
->label('Start time')
->interval(15) // a suggestion every 15 minutes (this is the default)
->
SmartTimePicker::make('start_time')
->default('9am'); // stored as 09:00, shown as "9:00 am"
SmartTimePicker::make('start_time')
->default(fn () => now()->format('H:i')); // the current time
SmartTimePicker::make('start_time')
->live(), // make it ->live() so end_time updates as it changes
SmartTimePicker::make('end_time')
->durationFrom('start_time'), // options read "(30 mins)", "(1 hour)", "(1h 30m)" …