F
Filament4mo ago
Sayy

Getting error display-text filter datepicker

getting error like this:
ReferenceError: displayText is not defined
at [Alpine] displayText (eval at safeAsyncFunction (livewire.js?id=cc800bf4:1176:21), <anonymous>:3:32)
ReferenceError: displayText is not defined
at [Alpine] displayText (eval at safeAsyncFunction (livewire.js?id=cc800bf4:1176:21), <anonymous>:3:32)
whats wrong my filter ?
->filters([
Tables\Filters\SelectFilter::make('is_active')
->label('Status')
->options([
true => 'Masih Dijual',
false => 'Tidak Dijual',
])
->native(false)
->placeholder('Pilih Status'),
Tables\Filters\Filter::make('created_at')
->form([
Forms\Components\DateTimePicker::make('created_from')
->label('Tanggal Awal')
->maxDate( now())
->native(false),

Forms\Components\DateTimePicker::make('created_until')
->label('Tanggal Akhir')
->native(false)
->maxDate(now()),
])
->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['created_from'],
fn(Builder $query, $date): Builder => $query->whereDate('created_at', '>=', $date),
)
->when(
$data['created_until'],
fn(Builder $query, $date): Builder => $query->whereDate('created_at', '<=', $date),
);
})
->columns(2)
])
->filtersFormColumns(2)
->filtersTriggerAction(
fn(Action $action) => $action
->button()
->label('Filter'),
)
->filters([
Tables\Filters\SelectFilter::make('is_active')
->label('Status')
->options([
true => 'Masih Dijual',
false => 'Tidak Dijual',
])
->native(false)
->placeholder('Pilih Status'),
Tables\Filters\Filter::make('created_at')
->form([
Forms\Components\DateTimePicker::make('created_from')
->label('Tanggal Awal')
->maxDate( now())
->native(false),

Forms\Components\DateTimePicker::make('created_until')
->label('Tanggal Akhir')
->native(false)
->maxDate(now()),
])
->query(function (Builder $query, array $data): Builder {
return $query
->when(
$data['created_from'],
fn(Builder $query, $date): Builder => $query->whereDate('created_at', '>=', $date),
)
->when(
$data['created_until'],
fn(Builder $query, $date): Builder => $query->whereDate('created_at', '<=', $date),
);
})
->columns(2)
])
->filtersFormColumns(2)
->filtersTriggerAction(
fn(Action $action) => $action
->button()
->label('Filter'),
)
No description
No description
1 Reply
Sayy
SayyOP4mo ago
before already set with native, after i remove native no error, and how if im using native ?
Want results from more Discord servers?
Add your server