Scheduling bug fixes. IO-153

This commit is contained in:
Patrick Fic
2021-02-01 11:04:33 -08:00
parent bf83ae5779
commit 5bbd56115e
4 changed files with 30 additions and 7 deletions

View File

@@ -102,17 +102,17 @@ exports.job = async (req, res) => {
(bucket) =>
bucket.gte <= jobHrs && (!!bucket.lt ? bucket.lt > jobHrs : true)
)[0];
console.log(pjobBucket.id, JobBucket.id, pjobBucket.id === JobBucket.id);
if (pjobBucket.id === JobBucket.id) {
//Theyre the same classification. Add it to the matrix.
const compDate = moment(pjob.scheduled_completion);
//Is the schedule completion behind today? If so, use today as it.
let dateToUse;
dateToUse = compDate.isValid()
? moment().diff(compDate, "days") <= 0
? moment().diff(compDate, "days") < 0
? compDate.format("yyyy-MM-DD")
: todayIsoString
: todayIsoString;
bucketMatrix[dateToUse] = {
...bucketMatrix[dateToUse],
out: (bucketMatrix[dateToUse].out || 0) + 1,