Documentation ¶
Index ¶
- func AllTime() *time.Period
- func CompareAscending(t1, t2 *timestamppb.Timestamp) int
- func PeriodBefore(t *timestamppb.Timestamp) *time.Period
- func PeriodBetween(t1, t2 *timestamppb.Timestamp) *time.Period
- func PeriodOnOrAfter(t *timestamppb.Timestamp) *time.Period
- func PeriodsConnected(p1, p2 *time.Period) bool
- func PeriodsIntersect(p1, p2 *time.Period) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAscending ¶
func CompareAscending(t1, t2 *timestamppb.Timestamp) int
CompareAscending returns -1 if t1 is before t2, 1 if t1 is after t2 and 0 if t1 is equal to t2
func PeriodBefore ¶
func PeriodBefore(t *timestamppb.Timestamp) *time.Period
func PeriodBetween ¶
func PeriodBetween(t1, t2 *timestamppb.Timestamp) *time.Period
func PeriodOnOrAfter ¶
func PeriodOnOrAfter(t *timestamppb.Timestamp) *time.Period
func PeriodsConnected ¶
PeriodsConnected returns true if there exists a (possibly empty) Period that is enclosed by both p1 and p2
For example
- `[2, 4)` and `[5, 7)` are not connected
- `[2, 4)` and `[3, 5)` are connected, because both enclose `[3, 4)`
- `[2, 4)` and `[4, 6)` are connected, because both enclose the empty period `[4, 4)`
func PeriodsIntersect ¶
PeriodsIntersect returns true if there exists a non-empty Period that is enclosed by both p1 and p2
For example
- `[2, 4)` and `[5, 7)` do not intersect
- `[2, 4)` and `[3, 5)` intersect, because both enclose `[3, 4)` which is non-empty
- `[2, 4)` and `[4, 6)` do not intersect, because both enclose the empty period `[4, 4)`
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.