Enforce 120-day maximum on FP workflow expiration date
This commit is contained in:
@@ -67,6 +67,12 @@ function validateFpWorkflowForm(body) {
|
||||
expDay.setHours(0, 0, 0, 0);
|
||||
if (expDay <= today) {
|
||||
errors.expirationDate = 'Expiration date must be in the future.';
|
||||
} else {
|
||||
const maxDate = new Date(today);
|
||||
maxDate.setDate(maxDate.getDate() + 120);
|
||||
if (expDay > maxDate) {
|
||||
errors.expirationDate = 'Expiration date cannot be more than 120 days from today.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user