Sha256: 85c76b01c820f95100416b6bf46f682eb526a1f63e7d1bf0004254d1f9a17e9d
Contents?: true
Size: 621 Bytes
Versions: 23
Compression:
Stored size: 621 Bytes
Contents
import Component from "@ember/component"; import { formatTime } from "client-app/lib/utilities"; import { later } from "@ember/runloop"; export default Component.extend({ didInsertElement() { later(this, this.updateTimes, 60000); }, updateTimes() { Array.from(document.querySelectorAll(".auto-update-time")).forEach(node => { const timestamp = parseInt(node.dataset.timestamp); if (!timestamp) return; const formatted = formatTime(timestamp); if (formatted !== node.innerText) { node.innerText = formatted; } }); later(this, this.updateTimes, 60000); } });
Version data entries
23 entries across 23 versions & 1 rubygems