duration

package
v0.0.0-...-b9a8969 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Overview

Package duration implements helpers to calculate time duration.

Index

Constants

This section is empty.

Variables

View Source
var (
	NotYet     = `not yet`
	JustNow    = `just now`
	LastMinute = `1 minute ago`
	Minutes    = `%d minutes ago`
	LastHour   = `1 hour ago`
	Hours      = `%d hours ago`
	Yesterday  = `yesterday`
	Days       = `%d days ago`
	Weeks      = `%d weeks ago`
	Months     = `%d months ago`
	Years      = `%d years ago`
)

Texts to be translated if necessary.

Functions

func ElapsedTime

func ElapsedTime(translator *locale.Language, t time.Time) string

ElapsedTime returns in a human readable format the elapsed time since the given datetime.

Types

This section is empty.

Jump to

Keyboard shortcuts

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