Make Memories week span sorting chronological
This commit is contained in:
@@ -567,13 +567,13 @@ pub async fn list_memories(
|
||||
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)),
|
||||
// For week span, sort by day of month, then by full timestamp (oldest first)
|
||||
// For week span, sort by full date + timestamp (chronological)
|
||||
MemoriesSpan::Week => {
|
||||
memories_with_dates.sort_by(|a, b| {
|
||||
// First, sort by day of month
|
||||
let day_cmp = a.1.day().cmp(&b.1.day());
|
||||
if day_cmp != std::cmp::Ordering::Equal {
|
||||
return day_cmp;
|
||||
// First, sort by full date (year, month, day)
|
||||
let date_cmp = a.1.cmp(&b.1);
|
||||
if date_cmp != std::cmp::Ordering::Equal {
|
||||
return date_cmp;
|
||||
}
|
||||
|
||||
// Then sort by full created timestamp (oldest to newest)
|
||||
|
||||
Reference in New Issue
Block a user