datetime

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBeforeAfterEnd = errors.New("before_cannot_be_after_end")

Functions

func EndOfDay

func EndOfDay(t time.Time) time.Time

func StartOfDay

func StartOfDay(t time.Time) time.Time

Types

type Period

type Period struct {
	Begin time.Time `json:"begin" yaml:"begin"`
	End   time.Time `json:"end" yaml:"end"`
}

func MonthOf

func MonthOf(t time.Time) Period

func MustPeriod added in v0.1.15

func MustPeriod(p Period, err error) Period

func NewPeriod added in v0.1.9

func NewPeriod(begin, end time.Time) (Period, error)

func PreviousMonthOf added in v0.1.9

func PreviousMonthOf(t time.Time) Period

func (Period) Contains added in v0.1.15

func (p Period) Contains(t time.Time) bool

func (Period) Within added in v0.1.9

func (p Period) Within(o Period) bool

Jump to

Keyboard shortcuts

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