Download the PHP package agashe/arabic-date without Composer
On this page you can find all versions of the php package agashe/arabic-date. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download agashe/arabic-date
More information about agashe/arabic-date
Files in agashe/arabic-date
Package arabic-date
Short Description Handle hijri/gregorian calendar in both arabic and english.
License MIT
Homepage https://github.com/agashe/ArabicDate
Informations about the package arabic-date
ArabicDate
A PHP Package to handle hijri/gregorian calendar in both arabic and english
Features
- Hijri/Gregorian calendars.
- Support both arabic/english.
- Very lightwieght , 0 dependencies.
- Easy to use , set few options and run.
Installation
Documentation
ArabicDate hijri converter depends on Kuwati Algorithm , in it's core a single class with few setters/gettes to configure your result.
After installation is done , include the class in your project by:
- including vendor/autoload.php for Native PHP projects
- or adding the class to your framework config , for example app/config/app.php for laravel ,
This table demonstrate the basic three setters , we use to initialize ArabicDate
Method | Parameter | Options | Description |
---|---|---|---|
setCalendar | string | 'hijri', 'gregorian' | Select the calendar |
setLanguage | string | 'arabic', 'english' | Select the language |
setFormat | string | Check the table below | Select the date format pattern |
ArabicDate uses the default PHP date format characters , this table shows all supported characters in hijri calendar. (for gregorian calendar , all characters work normally !!)
Format character | Description |
---|---|
d | Day of the month, 2 digits with leading zeros |
D | A textual representation of a day |
j | Day of the month without leading zeros |
m | Numeric representation of a month, with leading zeros |
M | A textual representation of a month |
n | Numeric representation of a month, without leading zeros |
y | A two digit representation of a year |
Y | A full numeric representation of a year, 4 digits |
h | 12-hour format of an hour with leading zeros |
H | 24-hour format of an hour with leading zeros |
i | Minutes with leading zeros |
s | Seconds with leading zeros |
a/A | AM/PM , but in arabic there's no lowercase and uppercase so they both are the same! |
This is the basic example for using ArabicDate
Examples
License
(ArabicDate) released under the terms of the MIT license.