Sha256: 1063cb84cadba6bc70bd3c3ae0e734745eb1efcd5e8c2aca8ed2d3aca0e94587

Contents?: true

Size: 593 Bytes

Versions: 9

Compression:

Stored size: 593 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

9 entries across 9 versions & 1 rubygems

Version Path
logster-2.1.0 client-app/app/components/update-time.js
logster-2.0.1 client-app/app/components/update-time.js
logster-2.0.0.pre client-app/app/components/update-time.js
logster-1.4.0.pre client-app/app/components/update-time.js
logster-1.3.4 client-app/app/components/update-time.js
logster-1.3.3 client-app/app/components/update-time.js
logster-1.3.2 client-app/app/components/update-time.js
logster-1.3.0 client-app/app/components/update-time.js
logster-1.3.pre client-app/app/components/update-time.js