Documentation
¶
Index ¶
Constants ¶
View Source
const MAX_SAFE_ITERATIONS = 10000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Period ¶
func (Period) ContainsInclusive ¶
Inclusive at both start and end
type Recurrence ¶
type Recurrence struct { Interval RecurrenceInterval `json:"period"` // Anchor can be an arbitrary anchor time for the recurrence. // It does not have to be the last or the next time. Anchor time.Time `json:"anchor"` }
func FromISODuration ¶
func (Recurrence) GetPeriodAt ¶
func (r Recurrence) GetPeriodAt(t time.Time) (Period, error)
Returns a period where p.Contains(t) is true
func (Recurrence) NextAfter ¶
NextAfter returns the next time after t that the recurrence should occur. If at t the recurrence should occur, it will return t.
func (Recurrence) PrevBefore ¶
PrevBefore returns the previous time before t that the recurrence should occur.
type RecurrenceInterval ¶
var ( RecurrencePeriodDaily RecurrenceInterval = RecurrenceInterval{datex.NewPeriod(0, 0, 0, 1, 0, 0, 0)} RecurrencePeriodWeek RecurrenceInterval = RecurrenceInterval{datex.NewPeriod(0, 0, 1, 0, 0, 0, 0)} RecurrencePeriodMonth RecurrenceInterval = RecurrenceInterval{datex.NewPeriod(0, 1, 0, 0, 0, 0, 0)} RecurrencePeriodYear RecurrenceInterval = RecurrenceInterval{datex.NewPeriod(1, 0, 0, 0, 0, 0, 0)} )
Click to show internal directories.
Click to hide internal directories.