converted all timestamps to string representation

This commit is contained in:
azivner
2017-12-10 12:56:59 -05:00
parent e3b708c322
commit 021f02bd8c
22 changed files with 304 additions and 96 deletions

View File

@@ -20,7 +20,7 @@ router.put('/:noteTreeId/:notePath', auth.checkApiAuth, async (req, res, next) =
await sql.replace('recent_notes', {
note_tree_id: noteTreeId,
note_path: notePath,
date_accessed: utils.nowTimestamp(),
date_accessed: utils.nowDate(),
is_deleted: 0
});
@@ -39,7 +39,7 @@ async function getRecentNotes() {
}
async function deleteOld() {
const cutoffDateAccessed = utils.nowTimestamp() - 24 * 60 * 60;
const cutoffDateAccessed = utils.dateStr(new Date(Date.now() - 24 * 60 * 60 * 1000));
await sql.doInTransaction(async () => {
await sql.execute("DELETE FROM recent_notes WHERE date_accessed < ?", [cutoffDateAccessed]);