blob: e326ac9fc98088cb3c7449a22c68a918d8b7a929 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package page
import "sort"
type PageList []*Page
func (p PageList) SortDate() PageList {
sort.Slice(p, func(i, j int) bool {
return p[i].Date.Time.After(p[j].Date.Time)
})
return p
}
func (p PageList) SortDateReverse() PageList {
sort.Slice(p, func(i, j int) bool {
return p[i].Date.Time.Before(p[j].Date.Time)
})
return p
}
|