timeutil

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TimeFuncs = map[string]func(time.Time) time.Time{
	"startOfHour":     StartOfHour,
	"endOfHour":       EndOfHour,
	"startOfDay":      StartOfDay,
	"endOfDay":        EndOfDay,
	"startOfWeek":     StartOfWeek,
	"endOfWeek":       EndOfWeek,
	"startOfMonth":    StartOfMonth,
	"endOfMonth":      EndOfMonth,
	"startOfCalendar": StartOfCalendar,
	"endOfCalendar":   EndOfCalendar,
	"startOfYear":     StartOfYear,
	"endOfYear":       EndOfYear,
}

Functions

func EndOfCalendar

func EndOfCalendar(now time.Time) time.Time

func EndOfDay

func EndOfDay(now time.Time) time.Time

func EndOfHour

func EndOfHour(now time.Time) time.Time

func EndOfMonth

func EndOfMonth(now time.Time) time.Time

func EndOfWeek

func EndOfWeek(now time.Time) time.Time

func EndOfYear

func EndOfYear(now time.Time) time.Time

func IsDateSpecified

func IsDateSpecified(what string) bool

func IsSameDay

func IsSameDay(a, b time.Time) bool

func ParseEnd

func ParseEnd(s string) (time.Time, error)

func ParseEndInLocation

func ParseEndInLocation(s string, loc *time.Location) (time.Time, error)

func ParseStart

func ParseStart(s string) (time.Time, error)

func ParseStartInLocation

func ParseStartInLocation(s string, loc *time.Location) (time.Time, error)

func ResolveTime

func ResolveTime(what string, t time.Time) (time.Time, error)

func StartOfCalendar

func StartOfCalendar(now time.Time) time.Time

func StartOfDay

func StartOfDay(now time.Time) time.Time

func StartOfHour

func StartOfHour(now time.Time) time.Time

func StartOfMonth

func StartOfMonth(now time.Time) time.Time

func StartOfWeek

func StartOfWeek(now time.Time) time.Time

func StartOfYear

func StartOfYear(now time.Time) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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