Correction calcul dates

This commit is contained in:
Jean-Christophe Engel 2025-04-24 11:34:06 +02:00
parent 9ac427415a
commit b6ced673dc

View File

@ -9,11 +9,12 @@
{{:assign ts_debut=$date_debut|strtotime}} {{:assign ts_debut=$date_debut|strtotime}}
{{:assign ts_fin=$date_fin|strtotime}} {{:assign ts_fin=$date_fin|strtotime}}
{{:assign nbjours="1+(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}}
{{* au cas où les deux dates seraient inversées ... *}} {{if $ts_debut <= $ts_fin}}
{{if $nbjours < 0}} {{:assign nbjours="(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}}
{{:assign nbjours="-1*%d"|math:$nbjours}} {{else}}
{{:assign nbjours="(%d-%d)/(60*60*24)"|math:$ts_debut:$ts_fin}}
{{/if}} {{/if}}
{{* pour simplifier : 360 jours par an *}} {{* pour simplifier : 360 jours par an *}}
{{:assign nbjours="round(%f/365*360)"|math:$nbjours}} {{:assign nbjours="round(%f/365*360)"|math:$nbjours}}