2017 © Pedro Peláez
 

symfony-bundle knp-time-bundle

Knplabs time bundle makes your dates look sensible and descriptive

image

staspiv/knp-time-bundle

Knplabs time bundle makes your dates look sensible and descriptive

  • Thursday, August 18, 2016
  • by StasPiv
  • Repository
  • 1 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 72 Forks
  • 0 Open issues
  • 13 Versions
  • 56 % Grown

The README.md

Friendly ago dates ("5 minutes ago")!

Build Status, (*1)

This bundle does one simple job: takes dates and gives you friendly "2 hours ago"-type messages. Woh!, (*2)

```html+jinja Last edited {{ post.updatedAt|ago }} , (*3)


The date formatted can be translated into any language, and may are supported out of the box. ## INSTALLATION via Composer composer require knplabs/knp-time-bundle ## CONFIGURATION Register the bundle: ```php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Knp\Bundle\TimeBundle\KnpTimeBundle(), ); // ... }

Enable the translation component if you haven't already done it:, (*4)

# app/config/config.yml
framework:
    # ...
    translator:      { fallback: '%locale%' } # uncomment this line if you see this line commented

USAGE

In PHP!, (*5)

<?php
// Use the helper with Php
echo $view['time']->diff($dateTime); // returns something like "3 minutes ago"

In Twig!, (*6)

```html+jinja {{ someDateTimeVariable|ago }} ... or use the equivalent function {{ time_diff(someDateTimeVariable) }}, (*7)


## TESTS If you want to run tests, please check that you have installed dev dependencies. ```bash ./vendor/bin/phpunit

Maintainers

Anyone can contribute to this repository (and it's warmly welcomed!). The following people maintain and can merge into this library:, (*8)

  • akovalyov
  • weaverryan

The Versions

18/08 2016

dev-master

9999999-dev http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

11/07 2016

dev-feature/add-datetimeimmutable-support

dev-feature/add-datetimeimmutable-support http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

10/05 2016

1.6.1

1.6.1.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

22/04 2016

1.6.0

1.6.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

24/11 2015

1.5.3

1.5.3.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

12/11 2015

1.5.2

1.5.2.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

The Development Requires

bundle date time knplabs knp descriptive time

11/11 2015

1.5.1

1.5.1.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

07/10 2015

1.5.0

1.5.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

17/09 2015

1.4.0

1.4.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

12/12 2013

v1.3

1.3.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

15/11 2013

v1.2

1.2.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

11/01 2013

v1.1

1.1.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time

11/01 2013

v1.0

1.0.0.0 http://github.com/KnpLabs/KnpTimeBundle

Knplabs time bundle makes your dates look sensible and descriptive

  Sources   Download

MIT

The Requires

 

bundle date time knplabs knp descriptive time