Skip to content

Node.js based forum software built for the modern web

refactor: remove setting hours when updating graph

Barış Soner Uşaklı81b9d0caea62
diff --git a/public/src/admin/dashboard.js b/public/src/admin/dashboard.js
index 6e5488ea71..2c02cd1057 100644
--- a/public/src/admin/dashboard.js
+++ b/public/src/admin/dashboard.js
@@ -358,15 +358,10 @@ function setupGraphs(callback) {
return;
}
const units = amount === '1' ? 'hours' : 'days';
- let until = new Date();
- if (amount !== '1') {
- until.setHours(0, 0, 0, 0);
- }
if (amount === '1') { // change 1 day to 24 hours
amount = '24';
}
- until = until.getTime();
- updateTrafficGraph(units, until, amount);
+ updateTrafficGraph(units, new Date().getTime(), amount);
$('[data-action="updateGraph"] option[value="range"]').addClass('hidden');
});