shalior/filament-persian-date-field
最新稳定版本:v2.0.1
Composer 安装命令:
composer require shalior/filament-persian-date-field
包简介
A FilamentPhp form field to pick persian dates
README 文档
README
Installation
You can install the package via composer:
composer require shalior/filament-persian-date-field
To use with filament v2 use version ^1
You can publish the config file with:
php artisan vendor:publish --tag="filament-persian-date-field-config"
Usage
You'll use this component with Filament forms.
It syncs the related gregorian date (as string: Y-m-d) with your LiveWire component.
Use the field like any other filament form fields:
protected function getFormSchema(): array { return [ \Shalior\FilamentPersianDateField\Components\PersianDatePicker::make('persianDate') ->id('persian-date') ->maxDate(now()->format('Y-m-d')) ->minDate(now()->subWeek()->format('Y-m-d')) ->withoutTime() ->viewMode('month') // accepts 'day', 'month', 'year' ->default('2022-04-28'), ]; }
Persian date table column
You can use this field as a column in your table:
The column assumes you've installed verta or morilog/jalali
if neither of them is installed, it will use Carbon's translatedFormat()
Shalior\FilamentPersianDateField\Columns::make('created_at') ->translateLabel() ->format('Y/m/d') // default is 'H:i:s Y/m/d' ->timeZone('Asia/Tehran'), // default is 'Asia/Tehran' // renders as: ۱۳۹۹/۰۸/۰۱ in the table
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
I Encourage you to do so.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 2.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-28
