summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pöschel <[email protected]>2023-04-15 12:46:47 +0200
committerLuke from DC <[email protected]>2023-05-13 01:24:33 +0000
commit99a1e2a20567cbe988006d0fdfef6abab6324dc2 (patch)
tree63c5fb657826d359fb936cbf7da5b5f54785c857
parentc3662aedfb4e7bc28710a461fd643542c0ee8cd3 (diff)
downloadcaja-99a1e2a20567cbe988006d0fdfef6abab6324dc2.tar.bz2
caja-99a1e2a20567cbe988006d0fdfef6abab6324dc2.tar.xz
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.
-rw-r--r--libcaja-private/caja-file.c8
1 files 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