timeutil

package
v0.0.0-...-baf4ea5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package timeutil provides various time related utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Funcs

func Funcs(funcs template.FuncMap) template.FuncMap

func GraftYear

func GraftYear(target sql.NullTime, year string) sql.NullTime

Graft a year (in string form) onto a target time.

E.g. if the target time is 01-Jan-2020 and you graft "2021" onto it, result is 01-Jan-2021. If the provided year is not a valid integer, nothing will be done.

func ParseDateTimeString

func ParseDateTimeString(datestring, timestring string) (datetime sql.NullTime)

Types

type Timestatus

type Timestatus struct {
	Now             time.Time
	Start           sql.NullTime
	End             sql.NullTime
	IsOpen          bool
	NotYetOpen      bool
	AlreadyClosed   bool
	InvalidStartEnd bool
}

func ResolveTimestatus

func ResolveTimestatus(start, end sql.NullTime) (status Timestatus)

Jump to

Keyboard shortcuts

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