summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pöschel <[email protected]>2023-04-15 12:46:47 +0200
committerraveit65 <[email protected]>2023-10-12 12:44:12 +0200
commitb4267708fd0970e8d2be7833351593bc46f62b30 (patch)
tree52903463b20dd9af8b55c45c57728acc5006fc9c
parentff7a9042077966964d898ffb66e7846bab8fec89 (diff)
downloadcaja-b4267708fd0970e8d2be7833351593bc46f62b30.tar.bz2
caja-b4267708fd0970e8d2be7833351593bc46f62b30.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 32c3e650..1ebfc71e 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -4897,12 +4897,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