timewindow

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EveryDay = []string{"su", "mo", "tu", "we", "th", "fr", "sa"}

EveryDay Constant to say that all days are valid

Functions

This section is empty.

Types

type TimeWindow

type TimeWindow struct {
	// contains filtered or unexported fields
}

TimeWindow specifies a schedule of days and times.

func New

func New(days []string, startTime, endTime, location string) (*TimeWindow, error)

New creates a TimeWindow instance based on string inputs specifying a schedule.

func (*TimeWindow) Contains

func (tw *TimeWindow) Contains(t time.Time) bool

Contains determines whether the specified time is within this time window.

func (*TimeWindow) String

func (tw *TimeWindow) String() string

String returns a string representation of this time window.

Jump to

Keyboard shortcuts

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