v
This commit is contained in:
@@ -1187,13 +1187,24 @@ function changer_avenant_incorporation()
|
||||
});
|
||||
}
|
||||
|
||||
function get_age(dater)
|
||||
{
|
||||
function get_age(td2) {
|
||||
debugger;
|
||||
var td2 = $("#datejourfr_C").datepicker("getDate");
|
||||
return age = td2.getFullYear()-dater.getFullYear();
|
||||
// Vérifie si td2 est déjà un objet Date
|
||||
if (!(td2 instanceof Date)) {
|
||||
td2 = new Date(td2); // Convertit une chaîne ou un timestamp en Date
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - td2.getFullYear();
|
||||
|
||||
const m = today.getMonth() - td2.getMonth();
|
||||
if (m < 0 || (m === 0 && today.getDate() < td2.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
}
|
||||
|
||||
|
||||
function controle_age(dater, codeLienParente)
|
||||
{
|
||||
debugger;
|
||||
|
||||
Reference in New Issue
Block a user