mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-10-09 17:02:46 +02:00
up infos vélo
This commit is contained in:
parent
c0a1780fce
commit
0b760c20bc
7 changed files with 246 additions and 50 deletions
16
templates/admin/_labourage_time_ago.html.twig
Normal file
16
templates/admin/_labourage_time_ago.html.twig
Normal file
|
@ -0,0 +1,16 @@
|
|||
{# Template partiel pour afficher une date et le temps écoulé #}
|
||||
{% set now = "now"|date('U') %}
|
||||
{% set then = date|date('U') %}
|
||||
{% set diff = now - then %}
|
||||
{% set hours = (diff / 3600)|round(0, 'floor') %}
|
||||
{% set days = (diff / 86400)|round(0, 'floor') %}
|
||||
<span title="{{ date|date('d/m/Y H:i') }}">
|
||||
{{ date|date('d/m/Y H:i') }}
|
||||
{%- if days > 0 -%}
|
||||
(il y a {{ days }} jour{{ days > 1 ? 's' : '' }})
|
||||
{%- elseif hours > 0 -%}
|
||||
(il y a {{ hours }} heure{{ hours > 1 ? 's' : '' }})
|
||||
{%- else -%}
|
||||
(il y a moins d'une heure)
|
||||
{%- endif -%}
|
||||
</span>
|
Loading…
Add table
Add a link
Reference in a new issue