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 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);

View file

@ -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
};