Package Data | |
---|---|
Maintainer Username: | maherbusnes |
Maintainer Contact: | maherbusnes@gmail.com (Maher El Gamil) |
Package Create Date: | 2014-12-09 |
Package Last Update: | 2021-06-22 |
Home Page: | https://github.com/maherelgamil/arabicdatetime |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-14 15:05:17 |
Package Statistics | |
---|---|
Total Downloads: | 4,214 |
Monthly Downloads: | 7 |
Daily Downloads: | 0 |
Total Stars: | 41 |
Total Watchers: | 4 |
Total Forks: | 9 |
Total Open Issues: | 0 |
Easy and useful tool to generate arabic or hijri date with multi-language support for laravel .
Add Laravel ArabicDateTime to your composer.json
file.
"maherelgamil/arabicdatetime": "4.0.*"
Run composer install
to get the latest version of the package.
It's recommended that you use Composer, however you can download and install from this repository.
ArabicDateTime comes with a service provider for Laravel 4. You'll need to add it to your composer.json
as mentioned in the above steps, then register the service provider with your application.
Open app/config/app.php
and find the providers
key. Add Arabicdatetime\ArabicdatetimeServiceProvider
to the array.
...
Maherelgamil\Arabicdatetime\ArabicdatetimeServiceProvider::class
...
You can also add an alias to the list of class aliases in the same app.php
...
'Arabicdatetime' => Maherelgamil\Arabicdatetime\Facades\Arabicdatetime::class
...
Now . publish vendor
php artisan vendor:publish
//Arabicdatetime::date({unixtime} , {mode} , {schema} , {numericMode});
//This function take 4 Parameters :
//1- unixtime : ex '1418123530'
//2- mode :
0 for Arabic date
1 for Hijri date
//3- schema : as `php` schema , you can read this page for more info. : http://php.net/manual/en/function.date.php
//4- numericMode takes two types 'indian' or 'arabic' and 'arabic' is default
//for Gregorian date with Englsih numbers
Arabicdatetime::date(1418123530 , 0);
//for Hijri date with indian numbers
Arabicdatetime::date(1418123530 , 1 , 'd / m / y ' ,'indian');
//for Hijri date, there is an optional correction, You can add or subtract days with plus and minus
Arabicdatetime::setCorrection('+1');
Arabicdatetime::setCorrection('-1');
Arabicdatetime::getDays();
Arabicdatetime::getArabicDays();
Arabicdatetime::getMonths();
Arabicdatetime::getArabicMonths();
Arabicdatetime::getHijriMonths();
Arabicdatetime::getArabicHijriMonths();
Arabicdatetime::remainingTime(1418123530);
Arabicdatetime::leftTime(1418123530);
Arabicdatetime::leftRemainingTime(1418123530);
ArabicDateTime is an open-sourced laravel package licensed under the MIT license