PHP code example of ariaieboy / filament-jalali-datetime

1. Go to this page and download the library: Download ariaieboy/filament-jalali-datetime 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/ */

    

ariaieboy / filament-jalali-datetime example snippets


// config for Ariaieboy/FilamentJalaliDatetime
return [
    'date_format'=>'Y/m/d',
    'date_time_format'=>'Y/m/d H:i:s',
];

//instead of this :
use Filament\Tables\Columns\TextColumn;
 
TextColumn::make('created_at')->dateTime()

//Since v1.2 you can use the code below to show Jalali date and dateTime

TextColumn::make('created_at')->jalaliDate();
TextColumn::make('created_at')->jalaliDateTime();

//you can use the code below for jalali datetime
use Ariaieboy\FilamentJalaliDatetime\JalaliDateTimeColumn;
 
JalaliDateTimeColumn::make('created_at')->dateTime() // it will show the date like this : 1401/03/15 20:18:52
//or
JalaliDateTimeColumn::make('created_at')->date() // it will show the date like this : 1401/03/15

bash
php artisan vendor:publish --tag="filament-jalali-datetime-config"