Documentation ¶
Overview ¶
Package timeparse parses times in strings in a wide variety of formats to corresponding time.Times.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidTimeFormat = errors.New("invalid time format")
ErrInvalidTimeFormat is returned when time.Parse could not parse the time across all known valid time formats. For a list of valid time formats, see the unexported variables timeFormatsNoDay and timeFormatsWithDay in shared/helpers/timeparse.
Functions ¶
Types ¶
type TimeContext ¶
type TimeContext struct {
// contains filtered or unexported fields
}
TimeContext is a type used to extrapolate a single piece of info, like AMPM or the month across multiple times. If any item in TimeContext is nil, the information returned in the []time.Time slice corresponding to that was arrived at on a best-guess basis. You can (and should) add a logic layer to your own application which selects the most appropriate time based on your known context beyond the text provided to timeparse.