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

16 lines
387 B
JavaScript
Raw Normal View History

import Component from '@ember/component';
import moment from 'moment';
import {computed} from '@ember/object';
export default Component.extend({
tagName: '',
user: null,
lastLoginUTC: computed('user.lastLoginUTC', function () {
let lastLoginUTC = this.get('user.lastLoginUTC');
return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)';
})
});