Given a Duration, lossily format it like in ‘N days ago’.
Parsing it back to Duration is not supported yet (See
Multiple languages are supported though
isolang feature to gain support of getting Language impl from
You can configure minimum and maximum time units, as well as “precision” of how many items to emit.
Fractional results like “1.5 days ago” are not supported.
There is a special simplified version to get compact 5-character representation:
The main item of timeago is
A collection of natural languages supported out-of-the-box for the formatting.
Main formatter struct. Build it with new() and maybe modify some options, then use convert.
Simple formatting style for deprecated
Various units of time to specify as maximum or minimum. Note that calculations are approximate, not calendar-based.
Interface for connecting natural languages to use for the formatting See “language” module documentation for details.
Do the formatting. See
A simplified formatter, resulting in short strings like “02Yea” or “ now “ or “07min”. Designed to always give 5-character strings.
Dynamic version of the