This commit is contained in:
KONE SOREL 2026-01-02 13:53:58 +00:00
parent ae283231b7
commit 222a258f00
2 changed files with 16 additions and 5 deletions

View File

@ -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;

View File

@ -595,7 +595,7 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2026.01.02.04"></script>
<script src="/Js/fonctions.js?ver=2026.01.02.05"></script>
<script type="text/javascript">
setInterval(function() {