omalizadeh / laravel-jalali-calendar
A laravel package to get jalali events from time.ir
v1.0.1
2022-09-03 15:29 UTC
Requires
- php: ^7.4|^8.0
- ext-dom: *
- ext-json: *
- ext-libxml: *
- guzzlehttp/guzzle: ^6.5.5|^7.0.1
- illuminate/contracts: ^7.0|^8.0|^9.0
- illuminate/http: ^7.0|^8.0|^9.0
- illuminate/support: ^7.0|^8.0|^9.0
- morilog/jalali: ^3.2
Requires (Dev)
- orchestra/testbench: ^6.24|^7.0
README
Laravel Jalali Calendar
This is a laravel package to get jalali date events and holidays by parsing time.ir website.
⭐ Star! if you used & liked this package.
Installation
Install package with composer:
composer require omalizadeh/laravel-jalali-calendar
Usage
Get 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 |
License
- Laravel Jalali Calendar is open-sourced software licensed under the MIT license.
- This package is created based on Persiancalapi project.