mirror of
https://github.com/flarum/core.git
synced 2025-05-05 06:57:55 +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:
parent
dc738d68dc
commit
521cefbc2d
@ -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);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user