qduration

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	// contains filtered or unexported fields
}

func New

func New(span int, unit DurationUnit) Duration

func Parse

func Parse(durationS string) (Duration, error)

func (Duration) Abs

func (d Duration) Abs() Duration

func (Duration) AddTo

func (d Duration) AddTo(t time.Time) time.Time

func (Duration) Days

func (d Duration) Days() int

func (Duration) SubFrom

func (d Duration) SubFrom(t time.Time) time.Time

type DurationUnit

type DurationUnit int
const (
	Day DurationUnit = iota
	Week
	Month
	Year
)

Jump to

Keyboard shortcuts

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