Enforce 120-day maximum on FP workflow expiration date

This commit is contained in:
root
2026-04-22 19:52:06 +00:00
parent f3ba322403
commit e1b000870c
2 changed files with 14 additions and 1 deletions

View File

@@ -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.';
}
}
}
}