You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
All: Fix format of note timestamps (#2672)
* Correct format of timestamps during unserialization. * Add tests.
This commit is contained in:
@ -254,13 +254,13 @@ class BaseItem extends BaseModel {
|
||||
|
||||
const ItemClass = this.itemClass(type);
|
||||
|
||||
if (['created_time', 'updated_time', 'user_created_time', 'user_updated_time'].indexOf(propName) >= 0) {
|
||||
if (!propValue) return 0;
|
||||
propValue = moment(propValue, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format('x');
|
||||
} else if (['title_diff', 'body_diff'].indexOf(propName) >= 0) {
|
||||
if (['title_diff', 'body_diff'].indexOf(propName) >= 0) {
|
||||
if (!propValue) return '';
|
||||
propValue = JSON.parse(propValue);
|
||||
} else {
|
||||
if (['created_time', 'updated_time', 'user_created_time', 'user_updated_time'].indexOf(propName) >= 0) {
|
||||
propValue = (!propValue) ? '0' : moment(propValue, 'YYYY-MM-DDTHH:mm:ss.SSSZ').format('x');
|
||||
}
|
||||
propValue = Database.formatValue(ItemClass.fieldType(propName), propValue);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user