eschmar/time-ago-bundle
TimeAgoBundle provides a simple Twig filter for Symfony that expresses time differences in words, returning actual dates beyond ±7 days. Supports many languages, configurable date format, and future times. Install via Composer; works with Symfony 2.8–5.x.
|ago Twig filter turns any DateTime into human-readable copy ("3 minutes ago", "in 4 hours"), which is the default pattern users now expect in comment threads, notification centers, audit logs, activity feeds, and "last updated" badges. This is a small, well-understood feature slice — the kind that shows up in a dozen places across a product and is worth standardizing rather than hand-rolling per view.format) to tune the fallback per surface.Important caveat for the decision record: despite the framing, this is a Symfony bundle, not a Laravel package. It ships a bundle class, a config.yml tree, and a Twig extension — none of which plug into Laravel's service container or Blade. In a Laravel codebase, the equivalent build decision is Carbon::diffForHumans() (already a transitive dependency), which supports the same relative/absolute behavior and is actively maintained. The "buy" recommendation applies only if the target application is Symfony.
Adopt when:
DateTime objects into templates rather than pre-rendering strings in controllers or API resources.Look elsewhere when:
diffForHumans() / CarbonInterface — same output, actively maintained, zero new dependency.Intl.RelativeTimeFormat); a server-side Twig filter is the wrong layer.To executives (30 seconds):
This is a tiny, free, MIT-licensed component that gives users friendly timestamps — "3 minutes ago" instead of "2024-11-08 14:22:31" — across 26 languages. It's the difference between an interface that feels alive and one that feels like a database dump. The cost is effectively zero: no license fee, no vendor negotiation, no meaningful engineering lift. One constraint: it only fits our Symfony services. If the work in question is Laravel, we get the same result from code we already ship, at no additional cost.
To engineering:
Symfony 5 + Twig bundle providing an
|agofilter overDateTime. Single config key for the fallback format, bundle registration is one line, no ORM or container coupling. Translations for 26 locales are the actual value — that's the part we'd otherwise spend a sprint rebuilding badly.Two things to weigh honestly. First, it's unmaintained since March 2022 with essentially no downstream adoption, so treat it as vendored code: pin the version, and expect to fork if we ever move to Symfony 6/7. Second, the whole behavior is ~50 lines of datetime arithmetic — if the dependency-review policy is strict, lifting the filter and the translation YAML into our own
src/is a half-day of work with strictly better longevity.Recommendation: adopt on Symfony 5 where the translation catalog saves us real time; reimplement inline on Symfony 6+ or on Laravel.
How can I help you explore Laravel packages today?