feature/memories #35
@@ -285,7 +285,10 @@ pub async fn list_memories(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort by day of the month and time (using the created timestamp)
|
match span_mode {
|
||||||
|
// Sort by absolute time for a more 'overview'
|
||||||
|
MemoriesSpan::Month => memories_with_dates.sort_by(|a, b| a.1.cmp(&b.1)),
|
||||||
|
_ => {
|
||||||
memories_with_dates.sort_by(|a, b| {
|
memories_with_dates.sort_by(|a, b| {
|
||||||
let day_comparison = a.1.day().cmp(&b.1.day());
|
let day_comparison = a.1.day().cmp(&b.1.day());
|
||||||
|
|
||||||
@@ -300,6 +303,9 @@ pub async fn list_memories(
|
|||||||
day_comparison
|
day_comparison
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Sort by day of the month and time (using the created timestamp)
|
||||||
|
|
||||||
let items: Vec<MemoryItem> = memories_with_dates.into_iter().map(|(m, _)| m).collect();
|
let items: Vec<MemoryItem> = memories_with_dates.into_iter().map(|(m, _)| m).collect();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user