date

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TimeFromNatural added in v0.5.0

func TimeFromNatural(date string) (time.Time, error)

TimeFromNatural parses a human date into a time.Time.

Types

type Frozen

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

Frozen is a date provider returning always the same date.

func NewFrozen

func NewFrozen(date time.Time) Frozen

func NewFrozenNow

func NewFrozenNow() Frozen

func (*Frozen) Date

func (n *Frozen) Date() time.Time

type Now

type Now struct{}

Now is a date provider returning the current date.

func (*Now) Date

func (n *Now) Date() time.Time

type Provider

type Provider interface {
	Date() time.Time
}

Provider returns a date instance.

Jump to

Keyboard shortcuts

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