|
@@ -397,3 +397,10 @@ func SinceTime(t Time) time.Duration {
|
|
|
func UntilTime(t Time) time.Duration {
|
|
|
return t.Sub(CurrentTime())
|
|
|
}
|
|
|
+
|
|
|
+// sort
|
|
|
+type ByTime []Time
|
|
|
+
|
|
|
+func (a ByTime) Len() int { return len(a) }
|
|
|
+func (a ByTime) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
|
|
+func (a ByTime) Less(i, j int) bool { return a[i].Before(a[j]) }
|