additional date checking

This commit is contained in:
yamanq 2016-08-15 13:58:46 -04:00
parent 70d20ea40b
commit a35182ae82

View File

@ -182,7 +182,8 @@ Meteor.methods({
Meteor.user().profile.classes.indexOf(input.class) !== -1 && Meteor.user().profile.classes.indexOf(input.class) !== -1 &&
found.banned.indexOf(Meteor.userId()) === -1 && found.banned.indexOf(Meteor.userId()) === -1 &&
found.blockEdit.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.name.length <= 50 && input.description.length <= 150) {
input.confirmations = [Meteor.userId()]; input.confirmations = [Meteor.userId()];
@ -229,7 +230,8 @@ Meteor.methods({
} else if (Meteor.userId() === work.findOne({ } else if (Meteor.userId() === work.findOne({
_id: change._id _id: change._id
}).creator) { }).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({ Meteor.update({
_id: change._id _id: change._id
}, { }, {