PHP code example of pulseline / jalali-events
1. Go to this page and download the library: Download pulseline/jalali-events 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/ */
pulseline / jalali-events example snippets
use JalaliEvents;
$day = JalaliEvents::date('1405/04/03');
[
'jalali_year' => 1405,
'jalali_month' => 4,
'jalali_day' => 3,
'jalali_date' => '1405/04/03',
'gregorian_date' => '2026-06-24',
'weekday' => 3,
'is_holiday' => true,
'is_weekend' => false,
'source' => 'time.ir',
'events' => [
[
'title' => 'تاسوعای حسینی',
'category' => 'hijri',
'is_holiday' => true,
],
],
];
$isHoliday = JalaliEvents::isHoliday(
'1405/04/03'
);
true
$events = JalaliEvents::events(
'1405/04/03'
);
[
[
'title' => 'تاسوعای حسینی',
'category' => 'hijri',
'is_holiday' => true,
],
]
$days = JalaliEvents::between(
'1405/04/01',
'1405/04/10'
);
$holidays = JalaliEvents::holidaysBetween(
'1405/04/01',
'1405/04/31'
);
$count = JalaliEvents::holidayCount(
'1405/04/01',
'1405/04/31'
);
'connections' => [
'jalali' => [
'driver' => 'pgsql',
'host' => env('JALALI_DB_HOST', '127.0.0.1'),
'port' => env('JALALI_DB_PORT', '5432'),
'database' => env('JALALI_DB_DATABASE'),
'username' => env('JALALI_DB_USERNAME'),
'password' => env('JALALI_DB_PASSWORD'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
'sslmode' => 'prefer',
],
],
bash
php artisan migrate
bash
php artisan jalali-events:sync
bash
php artisan jalali-events:sync 1405
bash
php artisan jalali-events:sync 1405
bash
php artisan jalali-events:sync
text
jalali_calendar_days
jalali_events
text
config/database.php
bash
php artisan vendor:publish --tag=jalali-events-config
text
config/jalali-events.php
bash
php artisan jalali-events:sync
text
time.ir