PHPackages                             nowo-tech/relative-time-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. nowo-tech/relative-time-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

nowo-tech/relative-time-bundle
==============================

Format DateTime values as localized relative time strings (e.g. just now, 5 minutes ago) for Symfony and Twig.

v1.0.3(2w ago)08↓66.7%MITShellPHP &gt;=8.2 &lt;8.6CI passing

Since Jul 18Pushed 1w agoCompare

[ Source](https://github.com/nowo-tech/RelativeTimeBundle)[ Packagist](https://packagist.org/packages/nowo-tech/relative-time-bundle)[ Docs](https://github.com/nowo-tech/RelativeTimeBundle)[ GitHub Sponsors](https://github.com/HecFranco)[ RSS](/packages/nowo-tech-relative-time-bundle/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (6)Dependencies (28)Versions (5)Used By (0)

Relative Time Bundle
====================

[](#relative-time-bundle)

[![CI](https://github.com/nowo-tech/RelativeTimeBundle/actions/workflows/ci.yml/badge.svg)](https://github.com/nowo-tech/RelativeTimeBundle/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/faebee8d51ac1835cc73af9027a96dd145a0de3c4bff0d6750937efeca33fc20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f776f2d746563682f72656c61746976652d74696d652d62756e646c652e7376673f7374796c653d666c6174)](https://packagist.org/packages/nowo-tech/relative-time-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/18ce86da2d9e18390f98870a25b900daea49bd0d228bdc642a7389ca9c440160/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f776f2d746563682f72656c61746976652d74696d652d62756e646c652e737667)](https://packagist.org/packages/nowo-tech/relative-time-bundle)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/3f99b197569aa2dcfbefff17ecc68d74098e7f929d8b52dc40f3a898f740eae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242343f6c6f676f3d706870)](https://php.net)[![Symfony](https://camo.githubusercontent.com/1a126614274d9b3881d3583579aa40bfbc1b85ae18daf0dc9390bf413426abfb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d372e34253242253230253743253230382e30253230253743253230382e312532422d3030303030303f6c6f676f3d73796d666f6e79)](https://symfony.com)[![GitHub stars](https://camo.githubusercontent.com/72a95457b78f59beccf72c8c174be47cbab36d0e851dea4f6b5a6ce82664d1d9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f776f2d746563682f52656c617469766554696d6542756e646c652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nowo-tech/RelativeTimeBundle)[![Coverage](https://camo.githubusercontent.com/cd0704b56f1d56def350b6d0164316307bb2f47834225fd85443b6fb0059bc73/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f7665726167652d3130302532352d627269676874677265656e)](#tests-and-coverage)

> ⭐ **Found this useful?** Install from [Packagist](https://packagist.org/packages/nowo-tech/relative-time-bundle) and give it a star on [GitHub](https://github.com/nowo-tech/RelativeTimeBundle).

Symfony bundle that formats a `DateTime` (or timestamp / date string) as a localized relative time string: just now, 5 minutes ago, in 2 hours, hace un momento, hace 3 días, and so on.

[![FrankenPHP Friendly Worker Mode](docs/images/frankenphp-friendly.png)](docs/images/frankenphp-friendly.png)

This bundle is **FrankenPHP worker mode friendly**.

Features
--------

[](#features)

- **RelativeTimeFormatter** service with past and future wording
- **Twig** filters/functions: `relative_time` and `ago`
- **i18n** catalogues for `en`, `es`, `it`, `fr`, `pt`, `de`, `nl` (domain `NowoRelativeTimeBundle`)
- Configurable `just_now_threshold_seconds`, `max_unit`, locale and timezone defaults
- App-level translation overrides (REQ-I18N-001)

Quick example
-------------

[](#quick-example)

```
use Nowo\RelativeTimeBundle\Service\RelativeTimeFormatter;

public function __construct(private RelativeTimeFormatter $relativeTime) {}

public function label(\DateTimeInterface $createdAt): string
{
    return $this->relativeTime->format($createdAt, 'es');
    // → "hace 5 minutos"
}
```

```
{{ entity.createdAt|relative_time }}
{{ entity.createdAt|ago('es') }}
{{ relative_time(entity.publishedAt, 'fr') }}
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2, &lt; 8.6
- Symfony 7.4+ or 8.x (`symfony/translation`, Twig)
- Twig 3.8+ or 4.x

Demo
----

[](#demo)

```
make -C demo up-symfony8
# Demo started at: http://localhost:8008
```

FrankenPHP worker mode for production demos is documented in [DEMO-FRANKENPHP.md](docs/DEMO-FRANKENPHP.md).

Documentation
-------------

[](#documentation)

- [Installation](docs/INSTALLATION.md)
- [Configuration](docs/CONFIGURATION.md)
- [PSR evaluation (REQ-CS-007)](docs/PSR.md)
- [Usage](docs/USAGE.md)
- [Contributing](docs/CONTRIBUTING.md)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Changelog](docs/CHANGELOG.md)
- [Upgrading](docs/UPGRADING.md)
- [Release](docs/RELEASE.md)
- [Security](docs/SECURITY.md)
- [Engram](docs/ENGRAM.md)
- [Spec-driven development](docs/SPEC-DRIVEN-DEVELOPMENT.md)
- [GitHub Spec Kit](docs/SPEC-KIT.md)

### Additional documentation

[](#additional-documentation)

- [GitHub Actions CI requirements](docs/GITHUB_CI.md)
- [Demo (Symfony 7 &amp; 8)](demo/README.md) — run `make -C demo up-symfony8` from the bundle root.
- [Demo with FrankenPHP (development and production)](docs/DEMO-FRANKENPHP.md)

Tests and coverage
------------------

[](#tests-and-coverage)

LanguageLines (approx.)CommandPHP**100%**`make test-coverage`TypeScriptN/A—PythonN/A—```
make test
make test-coverage
make validate-translations
make release-check
```

CI enforces PHP coverage at **100%**.

Version policy
--------------

[](#version-policy)

The Composer package name is [`nowo-tech/relative-time-bundle`](https://packagist.org/packages/nowo-tech/relative-time-bundle). Source code and issues are in the GitHub repository [`nowo-tech/RelativeTimeBundle`](https://github.com/nowo-tech/RelativeTimeBundle).

We follow [Semantic Versioning](https://semver.org/). See [Changelog](docs/CHANGELOG.md) for release notes. Security support by major version is described in the [Security policy](.github/SECURITY.md#supported-versions).

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance98

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

4

Last Release

15d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e7947bfc3f2ce9574a18a2c60f3d95b5d1b0740e65dc929332c92f1df21f75ab?d=identicon)[HecFranco](/maintainers/HecFranco)

---

Top Contributors

[![HecFranco](https://avatars.githubusercontent.com/u/24323276?v=4)](https://github.com/HecFranco "HecFranco (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")

---

Tags

frankenphpi18nphprelative-timesymfonysymfony-bundletwigsymfonybundlei18ntwigtranslationdatetimetime agorelative-time

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nowo-tech-relative-time-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/nowo-tech-relative-time-bundle/health.svg)](https://phpackages.com/packages/nowo-tech-relative-time-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.7M446](/packages/easycorp-easyadmin-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

605.9M718](/packages/shopware-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.4k1.4M244](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[survos/simple-datatables-bundle

incorporate simple datatables, using twig and stimulus

106.7k23](/packages/survos-simple-datatables-bundle)[contao/core-bundle

Contao Open Source CMS

1231.7M3.2k](/packages/contao-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
