timeago

package module
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 11 Imported by: 0

README ¶

golang

Go Build Status Build Status Scrutinizer Code Quality GitHub

Fast and lightweight date time package that converts given date into "n time ago" format. The package has many cool features and several supported languages.

Follow the Official documentation for all the details

🚀 Quick Start

go get github.com/SerhiiCho/timeago/v2

📄 License

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

Documentation ¶

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func Parse ¶

func Parse(datetime interface{}, options ...string) string

Parse coverts given datetime into `x time ago` format. First argument can have 3 types: 1. int (Unix timestamp) 2. time.Time (Type from Go time package) 3. string (Datetime string in format 'YYYY-MM-DD HH:MM:SS')

func SetConfig ¶

func SetConfig(conf Config)

Types ¶

type Config ¶

type Config struct {
	Language     string
	Location     string
	Translations []Translation
}

type Translation ¶

type Translation struct {
	Language     string
	Translations map[string]string
}

Directories ¶

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL