Skip to content

Commit

Permalink
Merge pull request #1279 from mewtaylor/issue/gh-1278
Browse files Browse the repository at this point in the history
Fix GH-1278: Use birthOffset for age check
  • Loading branch information
mewtaylor committed Apr 24, 2017
2 parents de78abb + aed3093 commit f511035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/registration/steps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ module.exports = {
formData.user.birth.month - 1,
1
);
if (((Date.now() - birthdate) / (24*3600*1000*365.25)) < 13) {
if (((Date.now() - birthdate) / (24*3600*1000*365.25)) < this.props.birthOffset) {
return invalidate({
'user.birth.month': this.props.intl.formatMessage({id: 'teacherRegistration.validationAge'})
'user.birth.year': this.props.intl.formatMessage({id: 'teacherRegistration.validationAge'})
});
}
return this.props.onNextStep(formData);
Expand Down

0 comments on commit f511035

Please sign in to comment.