//是否满18岁
function in18(birthYear,birthMonth,birthDay) {
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth() +1;
var day = now.getDate();
var age = year - birthYear;
var count = 0;
if(age<18){
count ++ ;
};
if(age == 18){
if(birthMonth > month){
count ++ ;
}else if(birthMonth == month){
if(birthDay > day){
count ++ ;
}
};
};
return count;
}

 

/^[1-9]\d{5}((((19|[2-9][0-9])\d{2})(0?[13578]|1[02])(0?[1-9]|[12][0-9]|3[01]))|(((19|[2-9][0-9])\d{2})(0?[13456789]|1[012])(0?[1-9]|[12][0-9]|30))|(((19|[2-9][0-9])\d{2})0?2(0?[1-9]|1[0-9]|2[0-8]))|(((1[6-9]|[2-9][0-9])(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))0?229))\d{3}[0-9Xx]$/;

相关文章:

  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2021-07-09
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-11-12
  • 2021-06-04
  • 2022-12-23
相关资源
相似解决方案