Sha256: 87d59385ec370b7f48a94e6b191c18bfb3332ea537fb8c584f01f66e604832c8
Contents?: true
Size: 875 Bytes
Versions: 14
Compression:
Stored size: 875 Bytes
Contents
import classic from "ember-classic-decorator"; import { tagName } from "@ember-decorators/component"; import { computed } from "@ember/object"; import Component from "@ember/component"; import { formatTime } from "client-app/lib/utilities"; import { later } from "@ember/runloop"; const UPDATE_INTERVAL = 60_000; @classic @tagName("") export default class TimeFormatter extends Component { didInsertElement() { super.didInsertElement(...arguments); later(this, this.updateTime, UPDATE_INTERVAL); } @computed("timestamp") get title() { return moment(this.timestamp).format(); } @computed("timestamp") get time() { return formatTime(this.timestamp); } updateTime() { if (this.isDestroying || this.isDestroyed) { return; } this.notifyPropertyChange("timestamp"); later(this, this.updateTime, UPDATE_INTERVAL); } }
Version data entries
14 entries across 14 versions & 1 rubygems