Correctly sort posts during generation
This commit is contained in:
@ -13,6 +13,10 @@ protocol DateItem {
|
||||
|
||||
extension Sequence where Element: DateItem {
|
||||
|
||||
/**
|
||||
Sort the elements first by their start date (newer first),
|
||||
and then by id, if the start date is equal.
|
||||
*/
|
||||
func sortedByStartDateAndId() -> [Element] {
|
||||
sorted { (lhs, rhs) -> Bool in
|
||||
if lhs.startDate == rhs.startDate {
|
||||
|
Reference in New Issue
Block a user