Documentation
¶
Overview ¶
package unix provides methods for derving Unix timestamps from EDTF strings.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateRange ¶
type DateRange struct {
// Outer is a `DateSpan` instance which matches the lower value of a starting date range and the upper value of an ending date range.
Outer *DateSpan
// Outer is a `DateSpan` instance which matches the upper value of a starting date range and the lower value of an ending date range.
Inner *DateSpan
}
DateRange is a struct containing inner and outer `DateSpan` instances for an EDTF date string.
func DeriveRanges ¶
DeriveRanges will parse 'edtf_str' and return a boolean flag signaling that it was possible to derive date ranges and, when possible, a `DateRange` instance containing Unix timestamps. For example some EDTF date strings like ".." (indicating an "open" or "ongoing" date) are valid EDTF but not suitable for deriving a date range.
type DateSpan ¶
type DateSpan struct {
// Start is the Unix timestamp for the starting date.
Start int64
// End is the Unix timestamp for the ending date.
End int64
}
DateSpan is a struct containing Unix timestamps for a range of (two) dates. Dates before 1970-01-01 are represented as negative values.