2017 © Pedro Peláez
 

symfony-bundle time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

image

eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  • Saturday, February 25, 2017
  • by eschmar
  • Repository
  • 2 Watchers
  • 9 Stars
  • 13,087 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 23 Forks
  • 0 Open issues
  • 13 Versions
  • 5 % Grown

The README.md

TimeAgoBundle

Provides a simple twig filter for expressing time difference in words for Symfony. Uses a range of +-7 days, after that, the actual date is returned., (*1)

Install

Composer (Packagist):, (*2)

composer require eschmar/time-ago-bundle ^v2.0.0 # Symfony ^5.0

or for older symfony versions:, (*3)

composer require eschmar/time-ago-bundle ^v1.1.0 # Symfony ^4.x
composer require eschmar/time-ago-bundle ~v0.4.0 # Symfony ^2.8
composer require eschmar/time-ago-bundle ~v0.5.0 # Symfony ^3.4

app/Appkernel.php (Symfony <4):, (*4)

new Eschmar\TimeAgoBundle\EschmarTimeAgoBundle(),

Usage

{{ date('now')|ago }}
{# just now #}

{{ date('now').modify('-3 minutes')|ago }}
{# 3 minutes ago #}

{{ date('now').modify('-3 months')|ago('r') }}
{# actual date in 'r' format #}

{{ date('now').modify('+4 hours')|ago('r') }}
{# in 4 hours #}

Change default format in config.yml:, (*5)

eschmar_time_ago:
    format: 'Y-m-d H:i:s'

Translations available

  • Belarusian
  • Croatian
  • Czech
  • Danish
  • Dutch
  • English
  • French
  • Finnish
  • German
  • Hindi
  • Hungarian
  • Indonesian
  • Italian
  • Malay
  • Norwegian
  • Polish
  • Portuguese (Brazil)
  • Romanian
  • Russian
  • Slovenian
  • Spanish
  • Swedish
  • Tagalog
  • Turkish
  • Ukranian
  • Vietnamese

License

MIT License, (*6)

The Versions

25/02 2017

dev-develop

dev-develop https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

23/10 2016

dev-master

9999999-dev https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

23/10 2016

v0.3.2

0.3.2.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

15/10 2016

v0.3.1

0.3.1.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

09/10 2016

v0.3

0.3.0.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

07/10 2016

v0.2

0.2.0.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

05/10 2016

v0.1.6

0.1.6.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

05/10 2016

v0.1.5

0.1.5.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig bundle symfony time ago

04/10 2016

v0.1.4

0.1.4.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig symfony time ago

04/10 2016

v0.1.3

0.1.3.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig symfony time ago

04/10 2016

v0.1.2

0.1.2.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig symfony time ago

04/10 2016

v0.1.1

0.1.1.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig symfony time ago

04/10 2016

v0.1

0.1.0.0 https://github.com/eschmar/time-ago-bundle

Provides a simple twig filter for expressing time difference in words.

  Sources   Download

MIT

The Requires

 

twig symfony time ago