提交 8b503eaaed48916be7e0d92adb32119e64beae3c

作者 pangy
1 个父辈 7fa37973

修复 获取年龄日期错误

正在显示 1 个修改的文件 包含 2 行增加3 行删除
... ... @@ -65,7 +65,6 @@ function curDateTime() {
65 65 var year = d.getFullYear();
66 66 var month = d.getMonth() + 1;
67 67 var date = d.getDate();
68   - var day = d.getDay();
69 68 var curDateTime = year;
70 69 if (month > 9)
71 70 curDateTime = curDateTime + "-" + month;
... ... @@ -130,7 +129,7 @@ function analyzeIDCard(IDCard){
130 129 //获取当前年月日并计算年龄
131 130 var myDate = new Date();
132 131 var monthNow = myDate.getMonth() + 1;
133   - var dayNow = myDate.getDay();
  132 + var dayNow = myDate.getDate();
134 133 var age = myDate.getFullYear() - yearBirth;
135 134 if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
136 135 age--;
... ... @@ -162,7 +161,7 @@ function getAge(birthdate) {
162 161 //获取当前年月日并计算年龄
163 162 var myDate = new Date();
164 163 var monthNow = myDate.getMonth() + 1;
165   - var dayNow = myDate.getDay();
  164 + var dayNow = myDate.getDate();
166 165 var age = myDate.getFullYear() - yearBirth;
167 166 if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
168 167 age--;
... ...
注册登录 后发表评论