Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions modules/candidate_parameters/jsx/ConsentStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,29 @@ class ConsentStatus extends Component {
let consentWithdrawal = consentStatus + '_withdrawal';
let consentWithdrawal2 = consentStatus + '_withdrawal2';

date1 = myFormData[consentWithdrawal] ?
const withdrawDate1 = myFormData[consentWithdrawal] ?
myFormData[consentWithdrawal] : null;
date2 = myFormData[consentWithdrawal2] ?
const withdrawDate2 = myFormData[consentWithdrawal2] ?
myFormData[consentWithdrawal2] : null;

if (date1 !== date2) {
if (withdrawDate1 !== withdrawDate2) {
alert(label + ' withdrawal dates do not match!');
return;
}
if (date1 > today) {
if (withdrawDate1 > today) {
alert(
label
+ ' withdrawal date cannot be later than today!'
);
return;
}
if (withdrawDate1 < date1) {
alert(
label
+ ' withdrawal date cannot be earlier than response date!'
);
return;
}
}
}
// Set form data
Expand Down