Documentation ¶
Index ¶
Constants ¶
View Source
const ( // a short time format; like time.Kitchen but with 24-hour notation. Kitchen24 = "15:04" // a time format that just cares about the day and month. YearDay = "Jan_2" )
Variables ¶
This section is empty.
Functions ¶
func ParseWeekdays ¶ added in v0.7.0
ParseWeekdays takes a comma-separated list of abbreviated weekdays (e.g. sat,sun) and turns them into a slice of time.Weekday. It ignores any whitespace and any invalid weekdays.
Types ¶
type TimePeriod ¶ added in v0.8.0
TimePeriod represents a time period with a single beginning and end.
func NewTimePeriod ¶ added in v0.8.0
func NewTimePeriod(from, to time.Time) TimePeriod
NewTimePeriod returns a normalized TimePeriod given a start and end time.
func ParseTimePeriods ¶ added in v0.8.0
func ParseTimePeriods(timePeriods string) ([]TimePeriod, error)
ParseTimePeriods takes a comma-separated list of time periods in Kitchen24 format and turns them into a slice of TimePeriods. It ignores any whitespace.
func (TimePeriod) Includes ¶ added in v0.8.0
func (tp TimePeriod) Includes(pointInTime time.Time) bool
Includes returns true iff the given pointInTime's time of day is included in time period tp.
func (TimePeriod) String ¶ added in v0.8.0
func (tp TimePeriod) String() string
String returns tp as a pretty string.
Click to show internal directories.
Click to hide internal directories.