1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Cli: Allow setting user timestamps with "set" command

This commit is contained in:
Laurent Cozic
2019-10-11 19:49:47 +02:00
parent c98644b72f
commit 7d7975daf4
2 changed files with 9 additions and 6 deletions

View File

@ -238,11 +238,7 @@ class BaseItem extends BaseModel {
static serialize_format(propName, propValue) {
if (['created_time', 'updated_time', 'sync_time', 'user_updated_time', 'user_created_time'].indexOf(propName) >= 0) {
if (!propValue) return '';
propValue =
`${moment
.unix(propValue / 1000)
.utc()
.format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`;
propValue = `${moment.unix(propValue / 1000).utc().format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`;
} else if (['title_diff', 'body_diff'].indexOf(propName) >= 0) {
if (!propValue) return '';
propValue = JSON.stringify(propValue);