Download the PHP package abotalebie/jalali without Composer
On this page you can find all versions of the php package abotalebie/jalali. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jalali
abotalebie/jalali
-
Jalali calendar is a solar calendar that was used in Persia, variants of which today are still in use in Iran as well as Afghanistan. Read more on Wikipedia or see Calendar Converter.
-
Calendar conversion is based on the algorithm provided by Kazimierz M. Borkowski and has a very good performance.
- CalendarUtils class was ported from jalaali/jalaali-js
Version 3 features
- High human readable API
- DateTime manipulating API
- DateTime comparing API
- Immutable
Installation Version 3.*
Run the Composer update command
$ composer require abotalebie/jalali:3.*
Basic Usage
In the current version, I introduced Jalalian
class for manipulating Jalali date time
Jalalian
In version >= 1.1, you can use jdate()
instead of Jalalian::forge()
;
now([$timestamp = null])
Methods api
CalendarUtils
checkDate($year, $month, $day, [$isJalali = true])
toJalali($gYear, $gMonth, $gDay)
toGregorian($jYear, $jMonth, $jDay)
strftime($format, [$timestamp = false, $timezone = null])
createDateTimeFromFormat($format, $jalaiTimeString)
createCarbonFromFormat($format, $jalaiTimeString)
convertNumbers($string)
Formatting
For help in building your formats, checkout the PHP strftime() docs.
Notes
The class relies on strtotime()
to make sense of your strings, and strftime()
to handle the formatting. Always check the time()
output to see if you get false timestamps, it which case, means the class couldn't understand what you were asking it to do.
License
- This bundle is created based on Laravel-Date by Scott Travis (MIT Licensed).
- Jalali (Shamsi) DateTime class included in the package is created by Sallar Kaboli and is released under the MIT License.
- This package is created and modified by Morteza Parvini for Laravel >= 5 and is released under the MIT License.