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