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 }, {