Documentation
¶
Overview ¶
Package dateseq creates a sequence series of daily dates.
Index ¶
- type Sequence
- func (s Sequence) Exclude(list []string) Sequence
- func (s Sequence) ExcludeWeekends() Sequence
- func (s Sequence) Format(layout string) []string
- func (s Sequence) FromDate(date string) Sequence
- func (s Sequence) IncludeWeekends() Sequence
- func (s Sequence) Sequence() []time.Time
- func (s Sequence) SortAsc() Sequence
- func (s Sequence) SortDesc() Sequence
- func (s Sequence) Steps(i int) Sequence
- func (s Sequence) String() []string
- func (s Sequence) ToDate(date string) Sequence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
Sequence represents a slice of dates.
func (Sequence) Exclude ¶ added in v0.1.5
Exclude excludes a list of dates from the sequence. This shortens the sequence by the number of excluded dates. If steps is set, the sequence fill be filled up by the number of excluded dates.
func (Sequence) ExcludeWeekends ¶ added in v0.1.5
ExcludeWeekends excludes Saturday and Sunday from the sequence. Weekends are included by default.
func (Sequence) Format ¶ added in v0.1.3
Format returns the sequence as a slice with a string repesentation of the date in the specified layout.
func (Sequence) FromDate ¶ added in v0.1.5
FromDate starts the sequence from a given date. If the sequence is alredy generated by Steps(), it will truncate the sequence from that date. The direction back or forward in time will be determined by the sign of steps. If the sequence is not already generated, this methof will generate it.
func (Sequence) IncludeWeekends ¶ added in v0.1.5
IncludeWeekends includes Saturday and Sunday back into the sequence.
func (Sequence) SortAsc ¶ added in v0.1.5
SortAsc sorts a slice of dates in ascending order, i.e. 2006-01-02 comes before 2006-01-03
func (Sequence) SortDesc ¶ added in v0.1.5
SortDesc sorts a slice of dates in descending order, i.e. 2006-01-01 comes after 2006-01-02
func (Sequence) Steps ¶ added in v0.1.4
Steps creates a date sequence with the specified length of days ending now. The signing of steps will determine, if the sequence goes back of forward in time. Calls to Steps will reset the sequence slice to nil before generating an new sequence.