Download the PHP package soroosh/jalali without Composer
On this page you can find all versions of the php package soroosh/jalali. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package jalali
soroosh/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
-
Run the Composer update command
$ composer require soroosh/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)
Carbon api-difference
You can convert date/time to briannesbitt/carbon, thus being able to use it's API to work with PHP DateTime class.
Difference in months:
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.
All versions of jalali with dependencies
nesbot/carbon Version ^1.21 || ^2.0
beberlei/assert Version 3.*