avatar
min - max date of birth TypeScript
const year = dob.substring(dob.lastIndexOf('/') + 1);
const match = dob.split('/');
const maxDOB = Number(match[0]) > 12 || Number(match[1]) > 31 || Number(year) > Number(currentYear);
const minDOB = Number(match[0]) < 1 || Number(match[1]) < 1 || Number(year) < 1;
if (maxDOB || minDOB) {
  this.$ssn.removeClass('--invalid');
  this.$dob.addClass('--invalid');
  this.showError('Please enter a valid format MM/DD/YYYY');
  return false;
}
24
force user enter date of birth
You need to login to do this manipulation!