renamed dates in code as well

This commit is contained in:
zadam
2019-03-12 20:58:31 +01:00
parent f65fefe7b1
commit 1c41d459f0
29 changed files with 92 additions and 92 deletions

View File

@@ -16,15 +16,15 @@ const sql = require('../services/sql');
* @param {int} position
* @param {boolean} isInheritable
* @param {boolean} isDeleted
* @param {string} dateCreated
* @param {string} dateModified
* @param {string} utcDateCreated
* @param {string} utcDateModified
*
* @extends Entity
*/
class Attribute extends Entity {
static get entityName() { return "attributes"; }
static get primaryKeyName() { return "attributeId"; }
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "dateCreated"]; }
static get hashedProperties() { return ["attributeId", "noteId", "type", "name", "value", "isInheritable", "isDeleted", "utcDateCreated"]; }
constructor(row) {
super(row);
@@ -95,14 +95,14 @@ class Attribute extends Entity {
this.isDeleted = false;
}
if (!this.dateCreated) {
this.dateCreated = dateUtils.nowDate();
if (!this.utcDateCreated) {
this.utcDateCreated = dateUtils.nowDate();
}
super.beforeSaving();
if (this.isChanged) {
this.dateModified = dateUtils.nowDate();
this.utcDateModified = dateUtils.nowDate();
}
}