duration

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const EightHoursInMin = 8 * 60

Variables

This section is empty.

Functions

func ToMinutes

func ToMinutes(d string) int

ToMinutes converts string duration d "2D", "4h", "2H 30m", "1d 7h 40m", etc, to minutes. if it fails to process a duration, it returns (-1, error)

func ToString

func ToString(minutes int) string

Types

type Time

type Time struct {
	time.Time
}

func ParseTime

func ParseTime(date string) Time

ParseTime converts a string date into time.Time using custom datetime pattern from the config

func ParseTimeTruncatedToDate

func ParseTimeTruncatedToDate(date string) Time

ParseTimeTruncatedToDate converts a string date into time.Time using custom datetime pattern from the config, then trims the time part to zeroes

func (Time) Compare

func (t Time) Compare(other Time) int

func (Time) TruncateToDate

func (t Time) TruncateToDate() Time

Jump to

Keyboard shortcuts

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