mMerge branch 'master' of bitbucket.org:panleicim/appointment_tool_js

This commit is contained in:
2023-03-01 09:32:24 +01:00
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ const schedule = require("node-schedule");
const mongoManager = new MongoManager();
const SEVEN_DAYS_IN_S = 3600 * 24 * 7;
const THIRTY_DAYS_IN_S = 3600 * 24 * 30;
const NINETY_DAYS_IN_S = 3600 * 24 * 30 * 3;
let excelUtil = new ExcelUtil();
let collectionName = formatDate(new Date())
device_to_excludes = ["47e7e36b", "e30eb015"]
@@ -33,7 +33,7 @@ async function filterAlreadyAccepteddContacts(contactList) {
console.log("=====handle already accepted item before booking====");
console.log("accepted_at is " + acceptedItem.accepted_at);
console.log("accepted email is " + acceptedItem.email);
needToBook = acceptedItem.accepted_at + THIRTY_DAYS_IN_S <= (new Date()) / 1000;
needToBook = acceptedItem.accepted_at + NINETY_DAYS_IN_S <= (new Date()) / 1000;
if (!needToBook) {
console.log("already accepted appointment --> skip");
}
@@ -100,7 +100,7 @@ async function needToBook(contact, mongoManager) {
console.log("=====handle already accepted item====");
console.log("accepted_at is " + acceptedItem.accepted_at);
console.log("accepted email is " + acceptedItem.email);
needToBook = acceptedItem.accepted_at + THIRTY_DAYS_IN_S <= (new Date()) / 1000;
needToBook = acceptedItem.accepted_at + NINETY_DAYS_IN_S <= (new Date()) / 1000;
if (!needToBook) {
console.log("already accepted appointment --> skip");
}