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,