Timeago

Date and time library for your Go project that converts dates into 'time ago' format

golang

Build Status Scrutinizer Code Quality

Timeago is a fast and lightweight date time package that converts given date into human readable "n time ago" format in different languages, such as πŸ‡¬πŸ‡§ πŸ‡·πŸ‡Ί πŸ‡ΊπŸ‡¦ πŸ‡³πŸ‡± πŸ‡©πŸ‡ͺ πŸ‡¨πŸ‡³ πŸ‡§πŸ‡Ύ πŸ‡ͺπŸ‡Έ πŸ‡―πŸ‡΅ πŸ‡«πŸ‡·.

Quick Start

go get codeberg.org/timeago/timeago/v3

Codebase naming

Here are some of the naming conventions used in the codebase and their meanings for better understanding:

  • time unit - a single time unit like second, seconds, minute, minutes, etc.
  • time number - a number of time units like 1, 2, 3, etc. in a string like 1 minute ago, 2 minutes ago, 3 minutes ago, etc.
  • suffix - the suffix ago in the final output like 1 minute ago, 2 minutes ago, 3 minutes ago, etc.
  • time since - the final output result like 2 minutes, 3 minutes ago, Just now, Online, 3 years ago etc.

License

This project is open-sourced software licensed under the MIT license.

Contribute

Build an Image

To build an image, navigate to the root of the project and run this command.

With Podman:

podman-compose build

With Docker:

docker compose build

Run the Container

To run a container, navigate to the root of the project and run this command to enter the Linux container with Go installed.

With Podman:

podman-compose up -d

With Docker:

docker compose up -d

Enter the Container

With Podman:

podman-compose exec app sh

With Docker:

docker compose exec app sh

Inside of this container you'll be able to run make commands like make test to run tests.