Fixes #2596 incorrect date types for created & updated

This commit is contained in:
Justin Reynolds 2019-09-05 12:29:45 -05:00
parent 2c78aab3dc
commit 3b9f2ca7c2
22 changed files with 103 additions and 33 deletions

View file

@ -14,6 +14,16 @@ Actions.allow({
},
});
Actions.before.insert((userId, doc) => {
doc.createdAt = new Date();
doc.modifiedAt = doc.createdAt;
});
Actions.before.update((userId, doc, fieldNames, modifier) => {
modifier.$set = modifier.$set || {};
modifier.$set.modifiedAt = new Date();
});
Actions.helpers({
description() {
return this.desc;