Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCompatibility ¶
Types ¶
type AbsoluteTime ¶ added in v0.60.7
type AbsoluteTime struct {
ISO string `parser:"@ISOTime"`
// contains filtered or unexported fields
}
type EvalOptions ¶
type Expression ¶
type Expression struct {
From *Link `parser:"@@"`
To *Link `parser:"(To @@)?"`
Grain *string `parser:"(By @Grain)?"`
AnchorOverride *LabeledAnchor `parser:"('@' @@)?"`
TimeZone *string `parser:"('@' @TimeZone)?"`
// contains filtered or unexported fields
}
func Parse ¶
func Parse(from string, parseOpts ParseOptions) (*Expression, error)
func (*Expression) Eval ¶
func (e *Expression) Eval(evalOpts EvalOptions) (time.Time, time.Time, timeutil.TimeGrain)
type LabeledAnchor ¶ added in v0.60.7
type Link ¶ added in v0.60.7
type Link struct {
Parts []*LinkPart `parser:"@@ (Of @@)*"`
// contains filtered or unexported fields
}
Link represents a link of grains specifying the customisable anchors. EG: 7d of -1M : The 7day period of last month. 7day is relative to watermark unless something else is specified.
type LinkPart ¶ added in v0.60.7
type LinkPart struct {
Ordinal *Ordinal `parser:"( @@"`
Anchor *TimeAnchor `parser:"| @@"`
AbsoluteTime *AbsoluteTime `parser:"| @@"`
LabeledAnchor *LabeledAnchor `parser:"| @@)"`
}
type Ordinal ¶ added in v0.60.7
type Ordinal struct {
Grain string `parser:"@Grain"`
Num int `parser:"@Number"`
// contains filtered or unexported fields
}
Ordinal represent a particular sequence of a grain in the next order grain. EG: W2 - week 2 of the month. EG: M5 - month 5 of the year.
type ParseOptions ¶
ParseOptions allows for additional options that could probably not be added to the time range itself
Click to show internal directories.
Click to hide internal directories.