From 3b9f2ca7c2fffa230bb0c6d4254a88deb9fbb023 Mon Sep 17 00:00:00 2001 From: Justin Reynolds Date: Thu, 5 Sep 2019 12:29:45 -0500 Subject: Fixes #2596 incorrect date types for created & updated --- models/announcements.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'models/announcements.js') diff --git a/models/announcements.js b/models/announcements.js index c08710b8..7fdf8d8b 100644 --- a/models/announcements.js +++ b/models/announcements.js @@ -25,6 +25,8 @@ Announcements.attachSchema( autoValue() { if (this.isInsert) { return new Date(); + } else if (this.isUpsert) { + return { $setOnInsert: new Date() }; } else { this.unset(); } -- cgit v1.2.3-1-g7c22