1package trello
2
3// ByFirstEntered is a slice of ListDurations
4type ByFirstEntered []*ListDuration
5
6// ByFirstEntered returns the length of the receiver.
7func (durs ByFirstEntered) Len() int { return len(durs) }
8
9// Less takes two indexes i and j and returns true exactly if the ListDuration
10// at i was entered before j.
11func (durs ByFirstEntered) Less(i, j int) bool {
12	return durs[i].FirstEntered.Before(durs[j].FirstEntered)
13}
14
15// Swap takes two indexes i and j and swaps the ListDurations at the indexes.
16func (durs ByFirstEntered) Swap(i, j int) { durs[i], durs[j] = durs[j], durs[i] }
17