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

Version Path
logster-2.11.4 client-app/app/components/update-time.js
logster-2.11.3 client-app/app/components/update-time.js
logster-2.11.2 client-app/app/components/update-time.js
logster-2.11.1 client-app/app/components/update-time.js
logster-2.11.0 client-app/app/components/update-time.js
logster-2.10.1 client-app/app/components/update-time.js
logster-2.10.0 client-app/app/components/update-time.js
logster-2.9.8 client-app/app/components/update-time.js
logster-2.9.7 client-app/app/components/update-time.js
logster-2.9.6 client-app/app/components/update-time.js
logster-2.9.5 client-app/app/components/update-time.js
logster-2.9.4 client-app/app/components/update-time.js
logster-2.9.3 client-app/app/components/update-time.js
logster-2.9.2 client-app/app/components/update-time.js
logster-2.9.1 client-app/app/components/update-time.js
logster-2.9.0 client-app/app/components/update-time.js
logster-2.8.0 client-app/app/components/update-time.js
logster-2.7.1 client-app/app/components/update-time.js
logster-2.7.0 client-app/app/components/update-time.js
logster-2.6.3 client-app/app/components/update-time.js