A persian/jalali date/datetime resource filter for Laravel Nova
php: ^8.0
laravel/nova: ^4.0
Install the package into a Laravel app that uses Nova with Composer:
composer require mziraki/nova-persian-date-filter
Extend MZiraki\PersianDateFilter\PersianDateFilter
:
use MZiraki\PersianDateFilter\PersianDateFilter;
class DueOn extends PersianDateFilter
{...}
Add the field to your resource in the filters
method:
use App\Nova\Filters\DueOn;
DueOn::make()
->color('rgb(30, 136, 229)') // customize color
->locale('fa,en') // customize locale
->type('date'), // date or datetime
The filter extends the Laravel\Nova\Filters\Filter
filter, so all the usual methods are available.