From 7a350f6f01bc274b854947686ca3e803a68cbf6e Mon Sep 17 00:00:00 2001 From: vinay-debug <84920398+vinay-debug@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:45:22 +0530 Subject: [PATCH] Updated scheduling for mock drill --- .../enrollment.controller.delegate.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/api/enrollment/enrollment/enrollment.controller.delegate.ts b/src/api/enrollment/enrollment/enrollment.controller.delegate.ts index 1319277..61a4e2e 100644 --- a/src/api/enrollment/enrollment/enrollment.controller.delegate.ts +++ b/src/api/enrollment/enrollment/enrollment.controller.delegate.ts @@ -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,