fixed times displaying incorrectly - forgot to use date constructer instead of date function

This commit is contained in:
Expand-sys 2021-05-18 07:39:23 +10:00
parent 14561307b9
commit 8844d44577
2 changed files with 6 additions and 3 deletions

View file

@ -210,6 +210,7 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
console.log(logrec.timings); console.log(logrec.timings);
console.log("query finished " + Date.now()); console.log("query finished " + Date.now());
logsent = logsent.body.value; logsent = logsent.body.value;
console.log(logsent);
if (logsent == 1 || logsent == -1 || logsent == null) { if (logsent == 1 || logsent == -1 || logsent == null) {
logsent = undefined; logsent = undefined;
@ -223,10 +224,12 @@ app.get("/BankF", ensureAuthenticated, async function (req, res) {
logrec = await logrec.filter(({ to }) => to === req.session.user); logrec = await logrec.filter(({ to }) => to === req.session.user);
} }
for (i in logrec) { for (i in logrec) {
logrec[i].time = Date(logrec[i].time); logrec[i].time = new Date(logrec[i].time);
console.log(logrec[i].time);
} }
for (i in logsent) { for (i in logsent) {
logsent[i].time = Date(logsent[i].time); logsent[i].time = new Date(logsent[i].time);
console.log(logsent[i].time);
} }
console.log("begin render " + Date.now()); console.log("begin render " + Date.now());
res.render("bankf", { res.render("bankf", {

View file

@ -140,7 +140,7 @@ router.post("/bal", checkAdmin, async function (req, res) {
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
if (patch.body.value == true) { if ((await patch.body.value) == true) {
successes.push({ msg: "Change Funds Successful" }); successes.push({ msg: "Change Funds Successful" });
} }
res.render("adminsettings", { res.render("adminsettings", {