Diverses améliorations
This commit is contained in:
parent
31a0371ae2
commit
91b75e77d4
3 changed files with 12 additions and 8 deletions
|
|
@ -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}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue