Skip to content

Easy and useful tool to get arabic date with arabic characters for laravel 5.*

Notifications You must be signed in to change notification settings

arezk84/arabicdatetime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArabicDateTime

Easy and useful tool to generate arabic or hijri date with multi-language support for laravel .

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads StyleCI

Installation

Composer

Add Laravel ArabicDateTime to your composer.json file.

"maherelgamil/arabicdatetime": "4.0.*"

Run composer install to get the latest version of the package.

Manually

It's recommended that you use Composer, however you can download and install from this repository.

Laravel 5.*

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

Useage

Get date from unixtime

    //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');
    

Get Days with locale language

    Arabicdatetime::getDays();

Get Arabic Days

    Arabicdatetime::getArabicDays();

Get Months With locale language

    Arabicdatetime::getMonths();

Get Arabic Months

    Arabicdatetime::getArabicMonths();

Get Hijri Months with locale language

    Arabicdatetime::getHijriMonths();

Get Hijri Months

    Arabicdatetime::getArabicHijriMonths();

Get remainnig time

    Arabicdatetime::remainingTime(1418123530);

Get left time

    Arabicdatetime::leftTime(1418123530);

Get left or remaining time

    Arabicdatetime::leftRemainingTime(1418123530);

License

ArabicDateTime is an open-sourced laravel package licensed under the MIT license

About

Easy and useful tool to get arabic date with arabic characters for laravel 5.*

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%