Aded Task cleanup by number of weeks or months

This commit is contained in:
Brian McGonagill 2024-08-01 11:56:04 -05:00
parent e60c32894c
commit 98bcbcd256
6 changed files with 93 additions and 23 deletions

View file

@ -94,7 +94,6 @@ Meteor.methods({
let srvDate = moment(items[j].serveDateActual);
let today = moment();
let expired = moment(today).isAfter(srvDate);
// console.log("Expired: " + expired);
if (expired != true) {
removeMenu = false;
}
@ -108,16 +107,12 @@ Meteor.methods({
// next let's add the ids of any menus that are marked complete
let markedComplete = Menus.find({ menuComplete: true }).fetch();
// console.log("---- ---- ----");
// console.dir(markedComplete);
for (k = 0; k < markedComplete.length; k++) {
let menuId = markedComplete[k]._id;
removeMenuIds.push(menuId);
}
// console.log(" ----- Need to remove Menus: ");
console.dir(removeMenuIds);
// finally we'll cycle through the ids and remove the items we collected up.
for (l = 0; l < removeMenuIds.length; l++) {
Menus.remove({ _id: removeMenuIds[l] });
}