Sha256: d949892dc2d7c5cb340941fa4e89714574c34ae18c069342c8611411bcb17a13

Contents?: true

Size: 572 Bytes

Versions: 13

Compression:

Stored size: 572 Bytes

Contents

import Component from "@ember/component";
import { formatTime } from "client-app/lib/utilities";

export default Component.extend({
  didInsertElement() {
    const updateTimes = () => {
      Em.$(".auto-update-time").each(function() {
        const timestamp = parseInt(this.getAttribute("data-timestamp"), 10);
        const elem = this;
        const text = formatTime(timestamp);

        if (text !== elem.innerText) {
          elem.innerText = text;
        }
      });
      Em.run.later(updateTimes, 60000);
    };

    Em.run.later(updateTimes, 60000);
  }
});

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
logster-2.5.1 client-app/app/components/update-time.js
logster-2.5.0 client-app/app/components/update-time.js
logster-2.4.2 client-app/app/components/update-time.js
logster-2.4.1 client-app/app/components/update-time.js
logster-2.4.0 client-app/app/components/update-time.js
logster-2.3.3 client-app/app/components/update-time.js
logster-2.3.2 client-app/app/components/update-time.js
logster-2.3.1 client-app/app/components/update-time.js
logster-2.3.0 client-app/app/components/update-time.js
logster-2.2.0 client-app/app/components/update-time.js
logster-2.1.2 client-app/app/components/update-time.js
logster-2.1.1 client-app/app/components/update-time.js
logster-1.3.1 client-app/app/components/update-time.js