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 dc738d68dc
commit 521cefbc2d
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -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);
}