simplify formula and add comment

This commit is contained in:
Morris Jobke 2014-07-02 17:20:56 +02:00
parent 053b0a4063
commit b6aeea8c0b

View file

@ -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;