Merged PR 2476: added check for inactive case deadlines

added check for inactive case deadlines

Related work items: #24297
This commit is contained in:
Robert Bond
2026-07-15 12:41:10 +00:00
parent b00a2c0733
commit 95486f0164
4 changed files with 50 additions and 35 deletions
@@ -233,35 +233,41 @@ const RepCompleteSubmit = (props) => {
let filterFiles = [];
function showRepsEnded(endDate) {
let date = new Date();
date = new Date(date.toDateString());
let end = new Date(endDate);
end.setUTCHours(23);
end.setUTCMinutes(59);
end.setUTCSeconds(59);
end.toISOString();
if (!endDate) {
return false;
}
return end > date ? false : true;
const end = new Date(endDate);
if (Number.isNaN(end.getTime())) {
return false;
}
const today = new Date();
today.setHours(0, 0, 0, 0);
end.setHours(23, 59, 59, 999);
return end <= today;
}
const checkRepDatePassed = () => {
if (repFormData.representationType == "Questionnaire") {
if (repFormData.representationType === "Questionnaire") {
return false;
} else {
if (repFormData.representationType == "Final comments") {
return repFormData.hasOwnProperty(
"pinswg_finalcommentsduedate"
) && showRepsEnded(repFormData.pinswg_finalcommentsduedate)
? true
: false;
}
if (repFormData.representationType == "Statement") {
return repFormData.hasOwnProperty("pinswg_statementduedate") &&
showRepsEnded(repFormData.pinswg_statementduedate)
? true
: false;
}
}
if (repFormData.representationType === "Final comments") {
return showRepsEnded(repFormData.pinswg_finalcommentsduedate);
}
if (repFormData.representationType === "Statement") {
return (
showRepsEnded(repFormData.pinswg_statementduedate) ||
showRepsEnded(repFormData.pinswg_endofrepresentationperiod)
);
}
return false;
};
const triggerQuestionnaireDownload = async () => {