From a35182ae829335f1b6cea1363eb1cad52f482d5a Mon Sep 17 00:00:00 2001 From: yamanq Date: Mon, 15 Aug 2016 13:58:46 -0400 Subject: [PATCH] additional date checking --- hourglass/server/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 2105b55..0300f71 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -182,7 +182,8 @@ Meteor.methods({ Meteor.user().profile.classes.indexOf(input.class) !== -1 && found.banned.indexOf(Meteor.userId()) === -1 && found.blockEdit.indexOf(Meteor.userId()) === -1 && - input.dueDate.getTime() >= ref && worktype.indexOf(input.type) != -1 && + input.dueDate instanceof Date && input.dueDate.getTime() >= ref && + worktype.indexOf(input.type) != -1 && input.name.length <= 50 && input.description.length <= 150) { input.confirmations = [Meteor.userId()]; @@ -229,7 +230,8 @@ Meteor.methods({ } else if (Meteor.userId() === work.findOne({ _id: change._id }).creator) { - if (change.name.length <= 50 && worktype.indexOf(change.type) != -1 && input.dueDate.getTime() >= ref) { + if (change.name.length <= 50 && worktype.indexOf(change.type) != -1 && + input.dueDate instanceof Date && input.dueDate.getTime() >= ref) { Meteor.update({ _id: change._id }, {