Lines 154-160
Link Here
|
154 |
var dob = new Date($("#dateofbirth").datepicker( 'getDate' )); |
154 |
var dob = new Date($("#dateofbirth").datepicker( 'getDate' )); |
155 |
|
155 |
|
156 |
var year = dob.getFullYear(); |
156 |
var year = dob.getFullYear(); |
157 |
var month = dob.getMonth(); |
157 |
var month = dob.getMonth() + 1; |
158 |
var day = dob.getDate(); |
158 |
var day = dob.getDate(); |
159 |
|
159 |
|
160 |
$.ajax({ |
160 |
$.ajax({ |
Lines 163-171
Link Here
|
163 |
data: 'dateofbirth=' + year + '-' + month + '-' + day, |
163 |
data: 'dateofbirth=' + year + '-' + month + '-' + day, |
164 |
dataType: 'json', |
164 |
dataType: 'json', |
165 |
success : function(json, statut){ |
165 |
success : function(json, statut){ |
166 |
var age_string = "Age: "; |
166 |
var age_string = _('Age: '); |
167 |
if (json.years) { age_string += json.years + " year(s) "; } |
167 |
if (json.years) { age_string += json.years + _(' year(s) '); } |
168 |
if (json.months) { age_string += json.months + " month(s) "; } |
168 |
if (json.months) { age_string += json.months + _(' month(s)'); } |
169 |
var elem = $("#dateofbirth").siblings(".hint").first().html(age_string); |
169 |
var elem = $("#dateofbirth").siblings(".hint").first().html(age_string); |
170 |
}, |
170 |
}, |
171 |
}); |
171 |
}); |