lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day      = 24 * time.Hour
	Week     = 7 * Day
	Month    = 30 * Day
	Year     = 12 * Month
	LongTime = 42 * Year
)

Variables

This section is empty.

Functions

func CustomRelativeTime

func CustomRelativeTime(a, b time.Time, albl, blbl string, magnitudes []RelativeTimeMagnitude) string

func Ftoa

func Ftoa(num float64) string

Ftoa converts a float to a string with no trailing zeros.

func FtoaWithDigits

func FtoaWithDigits(num float64, digits int) string

FtoaWithDigits converts a float to a string but limits the resulting string to the given number of decimal places, and no trailing zeros.

func HumanizeTime

func HumanizeTime(then time.Time) string

func RelativeTime

func RelativeTime(a, b time.Time, albl, blbl string) string

Types

type Options

type Options struct {
	ConfigFile  string
	Debug       bool
	DebugFormat string
	Verbose     bool
}

func NewOptions

func NewOptions() *Options

NewOptions returns a new Options struct

type RelativeTimeMagnitude

type RelativeTimeMagnitude struct {
	D      time.Duration
	Format string
	DivBy  time.Duration
}

Jump to

Keyboard shortcuts

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