1
0
mirror of https://github.com/flarum/core.git synced 2025-07-21 08:41:17 +02:00

convert: common/utils/liveHumanTimes

This file isn't used anywhere. We should be calling it at some point. It has existed for 5 years.

Renamed function because it makes more sense for name to match file name (not that it matters when building)
This commit is contained in:
David Sevilla Martin
2020-06-23 09:41:24 -04:00
committed by Franz Liedke
parent 961930749c
commit 20c7615c36

View File

@@ -1,18 +1,18 @@
import humanTimeUtil from './humanTime'; import humanTime from './humanTime';
function updateHumanTimes() { function updateHumanTimes() {
$('[data-humantime]').each(function () { $('[data-humantime]').each(function () {
const $this = $(this); const $this = $(this);
const ago = humanTimeUtil($this.attr('datetime')); const ago = humanTime($this.attr('datetime'));
$this.html(ago); $this.html(ago);
}); });
} }
/** /**
* The `humanTime` initializer sets up a loop every 1 second to update * The `liveHumanTimes` initializer sets up a loop every 1 second to update
* timestamps rendered with the `humanTime` helper. * timestamps rendered with the `humanTime` helper.
*/ */
export default function humanTime() { export default function liveHumanTimes() {
setInterval(updateHumanTimes, 10000); setInterval(updateHumanTimes, 10000);
} }