2017 © Pedro PelĂĄez
 

library laravel-date-international

Date manipulator for laravel

image

approached/laravel-date-international

Date manipulator for laravel

  • Thursday, August 10, 2017
  • by approached
  • Repository
  • 2 Watchers
  • 5 Stars
  • 11,483 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 7 Versions
  • 9 % Grown

The README.md

Laravel date international

License Latest Stable Version Total Downloads, (*1)

With this package you can get easy formated date string in your language., (*2)

Demo

German:, (*3)

Date:
20.08.15
20.08.2015
20. August 2015
Donnerstag, 20. August 2015

Time:
13:21
13:21:54 (with seconds)

Full:
20.08.15 13:21
20.08.2015 13:21
20. August 2015 13:21
Donnerstag, 20. August 2015 13:21

Italy:, (*4)

Date:
20/08/15
20/ago/2015
20 agosto 2015
giovedĂŹ 20 agosto 2015

Time:
13:26
13:26:36 (with seconds)

Full:
20/08/15 13:26
20/ago/2015 13:26
20 agosto 2015 13:26
giovedĂŹ 20 agosto 2015 13:26:36 (with seconds)

English:, (*5)

Date:
8/20/15
Aug 20, 2015
August 20, 2015
Thursday, August 20, 2015

Time:
1:25 PM
1:25:28 PM (with seconds)

Full:
8/20/15, 1:25 PM
Aug 20, 2015, 1:25 PM
August 20, 2015 at 1:25 PM
Thursday, August 20, 2015 at 1:25:28 PM (with seconds)

Spanish:, (*6)

Date:
20/8/15
20/8/2015
20 de agosto de 2015
jueves, 20 de agosto de 2015

Time:
13:27
13:27:42 (with seconds)

Full:
20/8/15 13:27
20/8/2015 13:27
20 de agosto de 2015, 13:27
jueves, 20 de agosto de 2015, 13:27:42 (with seconds)

And many more..., (*7)

Installation

Languages

You can look all available language packages with:, (*8)

aptitude search language-pack-

Install some languages:, (*9)

sudo apt-get install language-pack-de language-pack-en language-pack-es language-pack-it
sudo locale-gen

Check your available languages:, (*10)

locale -a

Make sure that you have languages in format like this: de_DE, (*11)

Php extension

Install php international support:, (*12)

sudo apt-get install php-intl 

Check that this extension is included:, (*13)

php -m | grep intl

Laravel

Laravel require this package with composer:, (*14)

composer require approached/laravel-date-international

After updating composer, add the ServiceProvider to the providers array in config/app.php:, (*15)

Approached\LaravelDateInternational\ServiceProvider::class,

and

'Dateintl'=> Approached\LaravelDateInternational\DateIntlFacade::class,

Usage

Blade:, (*16)

    Date:<br>
    {{ dateintl_date('short', $date) }}<br>
    {{ dateintl_date('medium', $date) }}<br>
    {{ dateintl_date('long', $date) }}<br>
    {{ dateintl_date('full', $date) }}<br><br>

    Time:<br>
    {{ dateintl_time($date) }}<br>
    {{ dateintl_time($date, true) }} (with seconds)<br><br>

    Full:<br>
    {{ dateintl_full('short', $date) }}<br>
    {{ dateintl_full('medium', $date) }}<br>
    {{ dateintl_full('long', $date) }}<br>
    {{ dateintl_full('full', $date, true) }}  (with seconds)<br>

PHP:, (*17)

$str = Dateintl::full('short', $date);

Calendar:, (*18)

With the last parameter you can control which calendar you want to use:, (*19)

$str = Dateintl::full('short', $date, false, 'japanese');

Could be these values : - persian - japanese - buddhist - chinese - indian - islamic - hebrew - coptic - ethiopic, (*20)

License

MIT, (*21)

The Versions

10/08 2017

dev-master

9999999-dev https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

11/10 2016

1.3.0

1.3.0.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

25/08 2016

1.2.0

1.2.0.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

22/03 2016

1.1.3

1.1.3.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

15/01 2016

1.1.2

1.1.2.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

20/08 2015

1.1.0

1.1.0.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international

10/07 2015

1.0.0

1.0.0.0 https://github.com/approached/laravel-date-international

Date manipulator for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel date intl manipulator international