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_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 $nbjours < 0}}
{{:assign nbjours="-1*%d"|math:$nbjours}}
{{if $ts_debut <= $ts_fin}}
{{:assign nbjours="(%d-%d)/(60*60*24)"|math:$ts_fin:$ts_debut}}
{{else}}
{{:assign nbjours="(%d-%d)/(60*60*24)"|math:$ts_debut:$ts_fin}}
{{/if}}
{{* pour simplifier : 360 jours par an *}}
{{:assign nbjours="round(%f/365*360)"|math:$nbjours}}