Show relative time in log list + fix locale for handlebar formatTime/formatRelative

This commit is contained in:
Alexandre Aubin 2018-07-23 17:11:02 +00:00
parent 92c97487a8
commit eee196e090
3 changed files with 8 additions and 5 deletions

View file

@ -121,9 +121,7 @@
c.view('tools/tools_logs', {
"data": data,
formatDate: function() {
return this.started_at.getDate();
}
"locale": y18n.locale
});
});
});
@ -148,7 +146,8 @@
}
c.view('tools/tools_log', {
"log": log,
"next_number": log.logs.length == number ? number * 10:false
"next_number": log.logs.length == number ? number * 10:false,
"locale": y18n.locale
});
});
});

View file

@ -13,6 +13,7 @@
<div class="separator"></div>
{{#intl locales=locale}}
{{#if log.metadata}}
<div class="panel panel-default">
<div class="panel-heading">
@ -60,3 +61,4 @@
{{/log.logs}}</pre>
</div>
</div>
{{/intl}}

View file

@ -6,6 +6,7 @@
<div class="separator"></div>
{{#intl locales=locale}}
{{#if data}}
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
{{#data}}
@ -21,7 +22,7 @@
<div id="collapse-{{key}}" class="panel-collapse{{#if @first}}{{else}} collapse{{/if}}" role="tabpanel" aria-labelledby="heading-{{key}}">
<div class="list-group">
{{#value}}
<a href="#/tools/logs/{{ name }}" class="list-group-item"><small>{{ started_at }}</small> {{ description }}</a>
<a href="#/tools/logs/{{ name }}" class="list-group-item" title='{{formatTime started_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}'><small style="margin-right:20px;" >{{formatRelative started_at}}</small> {{ description }}</a>
{{/value}}
</div>
</div>
@ -30,3 +31,4 @@
{{/data}}
</div>
{{/if}}
{{/intl}}