fix storing date_modified for note

This commit is contained in:
azivner 2017-12-13 23:27:02 -05:00
parent b0cbe91784
commit 55bf903623
2 changed files with 3 additions and 7 deletions

View File

@ -142,6 +142,7 @@ async function updateNote(noteId, newNote, ctx) {
} }
const now = new Date(); const now = new Date();
const nowStr = utils.nowDate();
const historySnapshotTimeInterval = parseInt(await options.getOption('history_snapshot_time_interval')); 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, note_text: oldNote.note_text,
is_protected: 0, // will be fixed in the protectNoteHistory() call is_protected: 0, // will be fixed in the protectNoteHistory() call
date_modified_from: oldNote.date_modified, date_modified_from: oldNote.date_modified,
date_modified_to: now date_modified_to: nowStr
}); });
await sync_table.addNoteHistorySync(newNoteHistoryId); await sync_table.addNoteHistorySync(newNoteHistoryId);
@ -182,7 +183,7 @@ async function updateNote(noteId, newNote, ctx) {
newNote.detail.note_title, newNote.detail.note_title,
newNote.detail.note_text, newNote.detail.note_text,
newNote.detail.is_protected, newNote.detail.is_protected,
now, nowStr,
noteId]); noteId]);
await sync_table.addNoteSync(noteId); await sync_table.addNoteSync(noteId);

View File

@ -62,10 +62,6 @@ function isElectron() {
return !!process.versions['electron']; return !!process.versions['electron'];
} }
function formatTwoDates(origDate, newDate) {
return "orig: " + origDate + ", new: " + newDate;
}
function hash(text) { function hash(text) {
return crypto.createHash('sha1').update(text).digest('base64'); return crypto.createHash('sha1').update(text).digest('base64');
} }
@ -88,7 +84,6 @@ module.exports = {
fromBase64, fromBase64,
hmac, hmac,
isElectron, isElectron,
formatTwoDates,
hash, hash,
isEmptyOrWhitespace isEmptyOrWhitespace
}; };