Skip to content

Commit

Permalink
Date format corrections (#15333)
Browse files Browse the repository at this point in the history
* fix(cron): record nextDue as ISO string

* fix(cron): nextDue is an array

* fix(dates): record history in ISO
  • Loading branch information
SabreCat authored Oct 15, 2024
1 parent af17930 commit 97e0b31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/server/libs/cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function setIsDueNextDue (task, user, now) {
optionsForShouldDo.nextDue = true;
const nextDue = common.shouldDo(now, task, optionsForShouldDo);
if (nextDue && nextDue.length > 0) {
task.nextDue = nextDue;
task.nextDue = nextDue.map(dueDate => dueDate.toISOString());
}
}

Expand Down Expand Up @@ -439,7 +439,7 @@ export async function cron (options = {}) {
});

// Finished tallying
user.history.todos.push({ date: now, value: todoTally });
user.history.todos.push({ date: now.toISOString(), value: todoTally });

// tally experience
let expTally = user.stats.exp;
Expand All @@ -449,7 +449,7 @@ export async function cron (options = {}) {
expTally += common.tnl(lvl);
}

user.history.exp.push({ date: now, value: expTally });
user.history.exp.push({ date: now.toISOString(), value: expTally });

// Remove any remaining completed todos from the list of active todos
user.tasksOrder.todos = user.tasksOrder.todos
Expand Down

0 comments on commit 97e0b31

Please sign in to comment.