From 55bf9036238ee2d0a186a4afdf450c117e8dac54 Mon Sep 17 00:00:00 2001 From: azivner Date: Wed, 13 Dec 2017 23:27:02 -0500 Subject: [PATCH] fix storing date_modified for note --- services/notes.js | 5 +++-- services/utils.js | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/services/notes.js b/services/notes.js index 6bd94bbe6..f02fee4d8 100644 --- a/services/notes.js +++ b/services/notes.js @@ -142,6 +142,7 @@ async function updateNote(noteId, newNote, ctx) { } const now = new Date(); + const nowStr = utils.nowDate(); const historySnapshotTimeInterval = parseInt(await options.getOption('history_snapshot_time_interval')); @@ -170,7 +171,7 @@ async function updateNote(noteId, newNote, ctx) { note_text: oldNote.note_text, is_protected: 0, // will be fixed in the protectNoteHistory() call date_modified_from: oldNote.date_modified, - date_modified_to: now + date_modified_to: nowStr }); await sync_table.addNoteHistorySync(newNoteHistoryId); @@ -182,7 +183,7 @@ async function updateNote(noteId, newNote, ctx) { newNote.detail.note_title, newNote.detail.note_text, newNote.detail.is_protected, - now, + nowStr, noteId]); await sync_table.addNoteSync(noteId); diff --git a/services/utils.js b/services/utils.js index 09f5190d2..6f06a52a9 100644 --- a/services/utils.js +++ b/services/utils.js @@ -62,10 +62,6 @@ function isElectron() { return !!process.versions['electron']; } -function formatTwoDates(origDate, newDate) { - return "orig: " + origDate + ", new: " + newDate; -} - function hash(text) { return crypto.createHash('sha1').update(text).digest('base64'); } @@ -88,7 +84,6 @@ module.exports = { fromBase64, hmac, isElectron, - formatTwoDates, hash, isEmptyOrWhitespace }; \ No newline at end of file