BugFix#1636; fix the issue where the user could add anything for the birthday of his contacts
This commit is contained in:
parent
31ace947cb
commit
cee1e529f8
|
@ -37,6 +37,8 @@
|
||||||
"edit" = "edit";
|
"edit" = "edit";
|
||||||
"invalidemailwarn" = "The specified email is invalid";
|
"invalidemailwarn" = "The specified email is invalid";
|
||||||
"invaliddatewarn" = "The specified date is invalid.";
|
"invaliddatewarn" = "The specified date is invalid.";
|
||||||
|
"invalidmonthwarn" = "The specified month is invalid.";
|
||||||
|
"invalidyearwarn" = "The specified year is invalid.";
|
||||||
"new" = "new";
|
"new" = "new";
|
||||||
"Preferred Phone" = "Preferred Phone";
|
"Preferred Phone" = "Preferred Phone";
|
||||||
|
|
||||||
|
|
|
@ -94,15 +94,34 @@ function validateContactEditor() {
|
||||||
alert(_("invalidemailwarn"));
|
alert(_("invalidemailwarn"));
|
||||||
rc = false;
|
rc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var today = new Date();
|
||||||
|
var yyyy = today.getFullYear();
|
||||||
|
|
||||||
var byear = $('birthyear');
|
var byear = $('birthyear');
|
||||||
var bmonth = $('birthmonth');
|
var bmonth = $('birthmonth');
|
||||||
var bday = $('birthday');
|
var bday = $('birthday');
|
||||||
var bdayValue = byear.value + "-" + bmonth.value + "-" + bday.value;
|
|
||||||
if (bdayValue != "--" && !dateRegex.test(bdayValue)) {
|
if(byear.value <= yyyy && (byear.value.length == 4)){
|
||||||
alert(_("invaliddatewarn"));
|
if(bmonth.value <= 12 && bmonth.value >=1){
|
||||||
rc = false;
|
if(bday.value <= 31 && bday.value >=1){
|
||||||
|
var bdayValue = byear.value + "-" + bmonth.value + "-" + bday.value;
|
||||||
|
if (bdayValue != "--" && !dateRegex.test(bdayValue)) {
|
||||||
|
alert(_("invaliddatewarn"));
|
||||||
|
rc = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(_("invaliddatewarn"));
|
||||||
|
rc = false;}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(_("invalidmonthwarn"));
|
||||||
|
rc = false;}
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
alert(_("invalidyearwarn"));
|
||||||
|
rc = false;}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue