|
@@ -309,10 +309,17 @@ TalentInfoInfoDlg.initFileTable = function () {
|
|
|
if (data["rows"][k].option) {
|
|
|
//指定了选项
|
|
|
if (rel == "birthday") {
|
|
|
- let birthday = parseInt($("#" + rel).val().substring(0, 4));
|
|
|
- let currentYear = parseInt(new Date().getFullYear());
|
|
|
- let age = currentYear - (isNaN(birthday) ? 0 : birthday);
|
|
|
- if (isNaN(birthday) || (!isNaN(birthday) && age < data["rows"][k].option))
|
|
|
+ let age = 0;
|
|
|
+ if ($("#" + rel).val()) {
|
|
|
+ let birthDate = new Date($("#" + rel).val());//生日日期
|
|
|
+ let birthYear = birthDate.getFullYear();
|
|
|
+ let birthMonth = birthDate.getMonth() + 1;
|
|
|
+ let currentDate = new Date();//当前日期
|
|
|
+ let currentYear = currentDate.getFullYear();
|
|
|
+ let currentMonth = currentDate.getMonth() + 1;
|
|
|
+ age = (currentYear * 12 + currentMonth - birthYear * 12 - birthMonth) / 12;
|
|
|
+ }
|
|
|
+ if (age < data["rows"][k].option)
|
|
|
data["rows"][k].hidden = true;
|
|
|
} else {
|
|
|
let selectVal = $("#" + rel).data("value").toString();
|