承接 maherelgamil/arabicdatetime 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maherelgamil/arabicdatetime

最新稳定版本:4.2.0

Composer 安装命令:

composer require maherelgamil/arabicdatetime

包简介

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

README 文档

README

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.

    composer require maherelgamil/arabicdatetime

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

Laravel 5.* only

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

    //$arabDateTime->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

    //5 - Create a Arabicdatetime instance
    $arabDateTime = new Arabicdatetime();

    //for Gregorian date with Englsih numbers
    $arabDateTime->date(1418123530 , 0);

    //for Hijri date with indian numbers
    $arabDateTime->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
    $arabDateTime->setCorrection('+1');
    $arabDateTime->setCorrection('-1');

Get Days with locale language

    $arabDateTime->getDays();

Get Arabic Days

    $arabDateTime->getArabicDays();

Get Months With locale language

    $arabDateTime->getMonths();

Get Arabic Months

    $arabDateTime->getArabicMonths();

Get Hijri Months with locale language

    $arabDateTime->getHijriMonths();

Get Hijri Months

    $arabDateTime->getArabicHijriMonths();

Get remainnig time

    $arabDateTime->remainingTime(1418123530);

Get left time

    $arabDateTime->leftTime(1418123530);

Get left or remaining time

    $arabDateTime->leftRemainingTime(1418123530);

License

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

统计信息

  • 总下载量: 4.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 41
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 41
  • Watchers: 3
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-25