feature/gps-map-support #48
@@ -567,13 +567,13 @@ pub async fn list_memories(
|
|||||||
match span_mode {
|
match span_mode {
|
||||||
// Sort by absolute time for a more 'overview'
|
// Sort by absolute time for a more 'overview'
|
||||||
MemoriesSpan::Month => memories_with_dates.sort_by(|a, b| a.1.cmp(&b.1)),
|
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 => {
|
MemoriesSpan::Week => {
|
||||||
memories_with_dates.sort_by(|a, b| {
|
memories_with_dates.sort_by(|a, b| {
|
||||||
// First, sort by day of month
|
// First, sort by full date (year, month, day)
|
||||||
let day_cmp = a.1.day().cmp(&b.1.day());
|
let date_cmp = a.1.cmp(&b.1);
|
||||||
if day_cmp != std::cmp::Ordering::Equal {
|
if date_cmp != std::cmp::Ordering::Equal {
|
||||||
return day_cmp;
|
return date_cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Then sort by full created timestamp (oldest to newest)
|
// Then sort by full created timestamp (oldest to newest)
|
||||||
|
|||||||
Reference in New Issue
Block a user