daterange

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daterange

type Daterange struct {
	Latest time.Time
	Oldest time.Time
}

Daterange holds the end and start dates.

func FromString

func FromString(s string) (*Daterange, error)

`FromString` returns a pointer to a `Daterange` from string. The parameter `s`s' format is "<full-date>,<tzdata-id>,<interval>".

  • <full-date> "yyyy-mm-dd"
  • <tzdata-id> see https://www.iana.org/time-zones.
  • <interval> "<number><dayormonth><direction>"
  • <number> Natural number that starts from 1.
  • <dayormonth> "d" or "m"
  • <direction> "-" or "+"

See daterange_test.go for how to use this function.

func (*Daterange) UnmarshalJSON

func (r *Daterange) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL