Ghost/ghost/admin/app/components/gh-user-active.js

19 lines
507 B
JavaScript
Raw Normal View History

import Component from '@ember/component';
import classic from 'ember-classic-decorator';
import moment from 'moment';
import {computed} from '@ember/object';
import {tagName} from '@ember-decorators/component';
@classic
@tagName('')
export default class GhUserActive extends Component {
user = null;
@computed('user.lastLoginUTC')
get lastLoginUTC() {
let lastLoginUTC = this.get('user.lastLoginUTC');
return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)';
}
}