From 99a1e2a20567cbe988006d0fdfef6abab6324dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20P=C3=B6schel?= Date: Sat, 15 Apr 2023 12:46:47 +0200 Subject: caja-file: fix future informal date bug If informal date format is used, for future dates the today time format has been used by mistake, instead of the general time format. --- libcaja-private/caja-file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c index 97cbb9ec..6d07b24a 100644 --- a/libcaja-private/caja-file.c +++ b/libcaja-private/caja-file.c @@ -4883,12 +4883,12 @@ caja_file_fit_date_as_string (CajaFile *file, * internationalization's sake. */ - if (file_date_age < G_TIME_SPAN_DAY) { - formats = TODAY_TIME_FORMATS; - } else if (file_date_age < 2 * G_TIME_SPAN_DAY) { + if (file_date_age <= 0 || file_date_age > 2 * G_TIME_SPAN_DAY) { + formats = CURRENT_WEEK_TIME_FORMATS; + } else if (file_date_age > G_TIME_SPAN_DAY) { formats = YESTERDAY_TIME_FORMATS; } else { - formats = CURRENT_WEEK_TIME_FORMATS; + formats = TODAY_TIME_FORMATS; } /* Find the date format that just fits the required width. Instead of measuring -- cgit v1.2.1