time

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExternalInterval

func ExternalInterval(interval model.Interval) gqlmodel.StatsInterval

ExternalInterval converts internal to gqlmodel

func InternalInterval

func InternalInterval(interval gqlmodel.StatsInterval) model.Interval

InternalInterval converts gqlmodel to internal

func ParseTime

func ParseTime(now time.Time, value string, startOf bool, weekday time.Weekday) (time.Time, error)

ParseTime parses time.

func Validate

func Validate(value string) error

Validate tries to parse the input and only returns the error.

Types

type RelativeRange

type RelativeRange struct {
	From string
	To   string
}

RelativeRange represents a relative range.

type StaticRange

type StaticRange struct {
	From time.Time
	To   time.Time
}

StaticRange represents a concrete range.

func ParseRange

func ParseRange(now time.Time, r RelativeRange, interval model.Interval, startOf, endOf time.Weekday) ([]StaticRange, error)

ParseRange parses a range and converts it to static ranges.

Jump to

Keyboard shortcuts

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