mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-03 05:42:17 +00:00
Use moment to keep cached timeagos up to date
Blerugh.
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h5>
|
<h5>
|
||||||
{{ version.revision.user.name|default:'System' }}
|
{{ version.revision.user.name|default:'System' }}
|
||||||
<span class="float-right"><small><span class="fas fa-clock"></span> {{version.revision.date_created|naturaltime}}</small></span>
|
<span class="float-right"><small><span class="fas fa-clock"></span> <span class="time">{{version.revision.date_created|date:"c"}}</span> ({{version.revision.date_created}})</small></span>
|
||||||
</h5>
|
</h5>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p>
|
<p>
|
||||||
@@ -48,3 +48,15 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endcache %}
|
{% endcache %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
const times = document.getElementsByClassName("time");
|
||||||
|
var i;
|
||||||
|
for(i = 0; i < times.length; i++) {
|
||||||
|
times[i].innerHTML = moment(times[i].innerHTML).fromNow();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user