From afe7ffe8c31a27807e0a72ccc70b93a8ce369fd3 Mon Sep 17 00:00:00 2001 From: onezplpl Date: Sun, 4 Aug 2024 18:18:46 -0400 Subject: [PATCH] even better algorithm --- js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 0fae6cb..258329d 100644 --- a/js/app.js +++ b/js/app.js @@ -19,7 +19,7 @@ async function genTree(treeId) { console.log(entryDat); - let s = Math.pow(0.5,(new Date() - new Date(entryDat.datetime_created.$date)) / (1000*60*60*24)) + let s = 1 / ((new Date() - new Date(entryDat.datetime_created.$date)) + 1000*60*60); sum += s; users[entryDat.username] = (us ? us : 0) + s; entry = entryDat.parent_id;