Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Time Ago Bundle

Time Ago Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

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

Frequently asked questions about Time Ago Bundle
Can I use eschmar/time-ago-bundle in a Laravel application?
Not directly. It is a Symfony bundle that registers EschmarTimeAgoBundle and exposes a Twig |ago filter; Laravel has no bundle kernel and uses Blade by default. You can port the formatting logic or use Carbon's diffForHumans instead.
How do I install TimeAgoBundle in Symfony?
Install with composer require eschmar/time-ago-bundle ^v2.0.0 for Symfony ^5.0, or use ^v1.1.0 for Symfony ^4.x and older tags for 2.8 and 3.4. On Symfony below 4, register new Eschmar\TimeAgoBundle\EschmarTimeAgoBundle() in AppKernel; on 4 and newer, auto-discovery should handle it. Smoke-test bundle registration on your exact Symfony minor.
What does the |ago Twig filter do?
It renders a time difference in words within a plus or minus seven day window, for example 3 minutes ago or in 4 hours. Beyond that window it returns a formatted date, defaulting to Y-m-d H:i:s or using the format passed to the filter or config. The filter is the whole integration surface in Twig.
How do I configure the date format for TimeAgoBundle?
Set eschmar_time_ago.format in your Symfony YAML configuration; the default is Y-m-d H:i:s. You can also pass a PHP date format directly to the filter, such as |ago('r'), for dates outside the relative window. Keep the same format in config and templates if you need consistent output.
Does TimeAgoBundle support future dates?
Yes. The filter is direction-aware and renders values such as in 4 hours for future timestamps, as well as 3 minutes ago for past ones. Outside the plus or minus seven day range it falls back to the configured absolute date format.
Which Symfony versions does TimeAgoBundle support?
The README advertises Symfony 2.8 through 5.x using version tags: v2.0.0 targets Symfony ^5.0, v1.1.0 targets ^4.x, and older tags cover 2.8 and 3.4. There is no v3 line and no Symfony 6 or 7 support according to the technical assessment. The latest release is dated 2022-03-04.
Is TimeAgoBundle maintained and safe for production?
Treat it as unvetted for production: the package has 17 stars, 0 dependents, a single maintainer, no CI, and no advertised test suite. The last release was 2022-03-04, and the assessment calls it effectively abandoned upstream. The MIT license keeps legal risk low, but you should own tests or vendor/fork the code if you adopt it.
What are alternatives to TimeAgoBundle for Laravel relative dates?
For Laravel, Carbon's diffForHumans() is the natural alternative and is already available through the framework. It handles past and future values and respects the application locale. Wrap it in a Blade directive or a small formatter service rather than adding a Symfony Twig bundle.
How can I implement the same plus or minus seven day time-ago behavior in Laravel?
Use Carbon::parse($value)->locale(app()->getLocale())->diffForHumans() for the relative branch. Branch on abs(now()->diffInDays($value)) <= 7 and otherwise call format($configFormat) for the absolute fallback. Add unit tests for past, future, inside-week, and outside-week cases so you own the contract.
Does TimeAgoBundle include translations for many languages?
Yes, it ships 26 locale translation catalogs including English, French, German, Spanish, Russian, and many others. The package does not document a fallback contract or pluralization strategy, so edge cases such as 1 minutes ago need verification in your target locale. If the catalogs are the main value, vendor the translation resources under MIT with attribution and wire them into Laravel's lang files.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
muka/shape-reader
tdt/json
refinery29/php-cs-fixer-config
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules
loco/loco
starfederation/datastar-php
yupmin/modern-phystrix
stephenjude/extended-artisan-commands
lumphp/laravel-macroable
lumphp/laravel-collections
lumphp/laravel-contracts
sermepa/sermepa
arkecosystem/fortify