Skip to content

Commit

Permalink
Merge pull request #112 from REAN-Foundation/mockdrill_scheduling
Browse files Browse the repository at this point in the history
Updated scheduling for mock drill
  • Loading branch information
vinay-debug authored Nov 1, 2023
2 parents 0498534 + 7a350f6 commit d264a12
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/api/enrollment/enrollment/enrollment.controller.delegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,21 @@ export class EnrollmentControllerDelegate {
}
let dt = null;

dt = TimeHelper.addDuration(startDate, daysToAdd, DurationType.Day);
dt = TimeHelper.addDuration(dt, 270, DurationType.Minute);
const reminder = daysToAdd % 4;
const days = Math.ceil(daysToAdd / 4);
dt = TimeHelper.addDuration(startDate, days, DurationType.Day);
if (reminder === 1) {
dt = TimeHelper.addDuration(dt, 360, DurationType.Minute);
} else if (reminder === 2) {
dt = TimeHelper.addDuration(dt, 360 + 120 * 1, DurationType.Minute);
} else if (reminder === 3) {
dt = TimeHelper.addDuration(dt, 360 + 120 * 2, DurationType.Minute);
} else if (reminder === 0) {
dt = TimeHelper.addDuration(dt, 360 + 120 * 3, DurationType.Minute);
}

// dt = TimeHelper.addDuration(startDate, daysToAdd, DurationType.Day);
// dt = TimeHelper.addDuration(dt, 270, DurationType.Minute);

var createModel: EnrollmentTaskCreateModel = {
EnrollmentId : record.id,
Expand Down

0 comments on commit d264a12

Please sign in to comment.