mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 10:50:50 +08: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() {
|
||||
$('[data-humantime]').each(function () {
|
||||
const $this = $(this);
|
||||
const ago = humanTimeUtil($this.attr('datetime'));
|
||||
const ago = humanTime($this.attr('datetime'));
|
||||
|
||||
$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.
|
||||
*/
|
||||
export default function humanTime() {
|
||||
export default function liveHumanTimes() {
|
||||
setInterval(updateHumanTimes, 10000);
|
||||
}
|
Loading…
Reference in New Issue
Block a user