From 0d69a476bcf9b4f95d88a5ae0ecf30c8602c2a66 Mon Sep 17 00:00:00 2001 From: Alexandre Cloutier Date: Mon, 10 Mar 2014 12:16:12 -0400 Subject: [PATCH] add specific date for limiting the user to today's for his contact birthday --- UI/WebServerResources/UIxContactEditor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/WebServerResources/UIxContactEditor.js b/UI/WebServerResources/UIxContactEditor.js index 4163a2828..47813a1b2 100644 --- a/UI/WebServerResources/UIxContactEditor.js +++ b/UI/WebServerResources/UIxContactEditor.js @@ -97,14 +97,16 @@ function validateContactEditor() { var today = new Date(); var yyyy = today.getFullYear(); + var mm = today.getMonth(); + var dd = today.getDay(); var byear = $('birthyear'); var bmonth = $('birthmonth'); var bday = $('birthday'); if(byear.value <= yyyy && (byear.value.length == 4)){ - if(bmonth.value <= 12 && bmonth.value >=1){ - if(bday.value <= 31 && bday.value >=1){ + if(bmonth.value <= mm && bmonth.value <= 12 && bmonth.value >=1){ + if(bday.value <= dd && bday.value <= 31 && bday.value >=1){ var bdayValue = byear.value + "-" + bmonth.value + "-" + bday.value; if (bdayValue != "--" && !dateRegex.test(bdayValue)) { alert(_("invaliddatewarn"));