Skip to content

Commit b20631f

Browse files
committed
Fix validations
1 parent 7f449f9 commit b20631f

File tree

1 file changed

+5
-6
lines changed
  • src/shared/components/Settings/Profile/Education

1 file changed

+5
-6
lines changed

src/shared/components/Settings/Profile/Education/index.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ export default class Education extends ConsentComponent {
107107
const fromDate = new Date(newEducation.timePeriodFrom).setHours(0, 0, 0, 0);
108108
const toDate = new Date(newEducation.timePeriodTo).setHours(0, 0, 0, 0);
109109

110-
if (fromDate > currentDate // Start Date is in past or current
111-
|| fromDate >= toDate // Start Date is before End Date
112-
|| (newEducation.graduated && toDate > currentDate)) { // End Date is in past or current
113-
110+
if (fromDate > currentDate // Start Date is in past or current
111+
|| fromDate >= toDate // Start Date is before End Date
112+
|| (newEducation.graduated && toDate > currentDate)) { // End Date is in past or current
114113
invalid = true;
115114
}
116115
}
@@ -326,11 +325,11 @@ export default class Education extends ConsentComponent {
326325
newEducation[e.target.name] = e.target.value;
327326
} else {
328327
newEducation[e.target.name] = e.target.checked;
329-
if(e.target.checked) { // if gradated and toDate is in Future, nullify it
328+
if (e.target.checked) { // if graduated and toDate is in Future, nullify it
330329
const toDate = new Date(newEducation.timePeriodTo).setHours(0, 0, 0, 0);
331330
const currentDate = new Date().setHours(0, 0, 0, 0);
332331
if (toDate > currentDate) {
333-
newEducation.timePeriodTo = ''
332+
newEducation.timePeriodTo = '';
334333
}
335334
}
336335
}

0 commit comments

Comments
 (0)