Skip to content

Commit

Permalink
Merge pull request #15217 from achyutkneupane/time-generate
Browse files Browse the repository at this point in the history
Added TimePicker and time method with generate argument
  • Loading branch information
danharrin authored Jan 2, 2025
2 parents e4a7ecf + 63397f6 commit 464b343
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\TimePicker;
use Filament\Forms\Components\Toggle;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -89,6 +90,7 @@ public function getFormComponents(?string $model = null, array $exceptColumns =
$componentData['type'] = match (true) {
$type['name'] === 'boolean' => Toggle::class,
$type['name'] === 'date' => DatePicker::class,
$type['name'] === 'time' => TimePicker::class,
in_array($type['name'], ['datetime', 'timestamp']) => DateTimePicker::class,
$type['name'] === 'text' => Textarea::class,
$componentName === 'image', str($componentName)->startsWith('image_'), str($componentName)->contains('_image_'), str($componentName)->endsWith('_image') => FileUpload::class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,16 @@ public function getTableColumns(?string $model = null, array $exceptColumns = []
$columnData['searchable'] = [];
}

if (in_array($type['name'], [
'date',
])) {
if ($type['name'] === 'date') {
$columnData['date'] = [];
$columnData['sortable'] = [];
}

if ($type['name'] === 'time') {
$columnData['time'] = [];
$columnData['sortable'] = [];
}

if (in_array($type['name'], [
'datetime',
'timestamp',
Expand Down

0 comments on commit 464b343

Please sign in to comment.