From b6aeea8c0b920eff27a2dc69b79155f3384f7f89 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 2 Jul 2014 17:20:56 +0200 Subject: [PATCH] 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;