This is a laravel package to get jalali date events and holidays by parsing time.ir website.
⭐ Star! if you used & liked this package.
Install package with composer:
composer require omalizadeh/laravel-jalali-calendarGet a JalaliDate object by calling fromGregorian static method on JalaliCalendar class. example:
use Omalizadeh\JalaliCalendar\JalaliCalendar;
$jalaliDate = JalaliCalendar::fromGregorian('2020-05-24');Or you can get a collection of JalaliDate objects by giving a gregorian period.
use Omalizadeh\JalaliCalendar\JalaliCalendar;
$jalaliDates = JalaliCalendar::fromGregorianPeriod('2020-05-24', '2020-05-28');Then you can get different info from JalaliDate object. supported methods:
| Methods | Return type | Description |
|---|---|---|
| format() | string | Jalali date with given format |
| isHoliday() | bool | Check jalali date is holiday |
| events() | array | Get date's events |
- Laravel Jalali Calendar is open-sourced software licensed under the MIT license.
- This package is created based on Persiancalapi project.