mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Use existing file metadata for created and modified dates
NB: this definintely works on OSX. Other operating systems may have slightly different interpretations of birthtime. See: https://nodejs.org/api/fs.html#fs_class_fs_stats
This commit is contained in:
@@ -66,12 +66,12 @@ function createNote (storageKey, input) {
|
||||
}
|
||||
}
|
||||
}
|
||||
const noteData = Object.assign({}, input, {
|
||||
const noteData = Object.assign({}, {
|
||||
key,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
storage: storageKey
|
||||
})
|
||||
}, input)
|
||||
|
||||
CSON.writeFileSync(path.join(storage.path, 'notes', key + '.cson'), _.omit(noteData, ['key', 'storage']))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user