Documentation
¶
Overview ¶
Package datespec resolves relative dates and clock spans against an explicit civil-date reference, without reading a clock or performing I/O.
Index ¶
- func LastWeek(r Ref) (from, to civil.Date)
- func Month(r Ref) (from, to civil.Date)
- func Parse(s string, m Mode, r Ref) (domain.Moment, error)
- func ParseClock(s string, allow2400 bool) (civil.Minute, error)
- func ParseSpan(s string, m Mode, r Ref) (domain.BlockSpan, error)
- func Week(r Ref) (from, to civil.Date)
- type InputError
- type Mode
- type Ref
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Month ¶
Month returns the inclusive full calendar month containing r.Today. A zero reference date returns zero dates.
func Parse ¶
Parse resolves a date with an optional clock, or a bare clock on today. Keywords are case-insensitive and surrounding whitespace is ignored.
func ParseClock ¶
ParseClock parses H:MM or HH:MM, trimming surrounding whitespace. The clock 24:00 is accepted only when allow2400 is true.
Types ¶
type InputError ¶
type InputError struct {
// NamesBlock reports whether the diagnostic itself identifies a block span or endpoint.
NamesBlock bool
// BareClock reports that the diagnostic starts with the offending clock value.
BareClock bool
// contains filtered or unexported fields
}
InputError keeps historical problem JSON available to the CLI while Error describes an input failure without implementation prefixes.
func (*InputError) Error ¶
func (e *InputError) Error() string
func (*InputError) ProblemDetail ¶
func (e *InputError) ProblemDetail() string
ProblemDetail returns the original detail used in machine-readable errors. AIDEV-NOTE: CLI --json depends on this detail even when Error changes.