Diverses améliorations

This commit is contained in:
Jean-Christophe Engel 2025-04-24 11:57:15 +02:00
parent 31a0371ae2
commit 91b75e77d4
3 changed files with 12 additions and 8 deletions

View file

@ -9,11 +9,13 @@
{{: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}}
{{:debug nbjours=$nbjours}}