From 053b0a4063c9681608d62ed4af898a1a8465e357 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 2 Jul 2014 16:37:15 +0200 Subject: [PATCH 1/2] shade color for modified dates again, fix #9363 --- apps/files/js/filelist.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c7fccc5dd66..c1dae4efdcc 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -676,7 +676,11 @@ tr.append(td); // date column - var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000) - mtime)/60/60/24*5); + var modifiedColor = Math.round(((Math.round((new Date()).getTime()) - mtime)/60/60/24*5) / 1000); + // ensure that the brightest color is still readable + if (modifiedColor >= '160') { + modifiedColor = 160; + } td = $('').attr({ "class": "date" }); td.append($('').attr({ "class": "modified", From b6aeea8c0b920eff27a2dc69b79155f3384f7f89 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 2 Jul 2014 17:20:56 +0200 Subject: [PATCH 2/2] simplify formula and add comment --- apps/files/js/filelist.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index c1dae4efdcc..08d0acb8c7b 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -675,8 +675,9 @@ }).text(simpleSize); tr.append(td); - // date column - var modifiedColor = Math.round(((Math.round((new Date()).getTime()) - mtime)/60/60/24*5) / 1000); + // date column (1000 milliseconds to seconds, 60 seconds, 60 minutes, 24 hours) + // difference in days multiplied by 5 - brightest shade for files older than 32 days (160/5) + var modifiedColor = Math.round(((new Date()).getTime() - mtime )/1000/60/60/24*5 ); // ensure that the brightest color is still readable if (modifiedColor >= '160') { modifiedColor = 160;