Looking to hire Laravel developers? Try LaraJobs

laravel-jalali-calendar maintained by omalizadeh

Description
A laravel package to get jalali events from time.ir
Author
Last update
2022/09/03 20:39 (dev-main)
License
Downloads
2

Comments
comments powered by Disqus

License Tests Latest Stable Version Total Downloads

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.