2017-08-22 10:53:26 +03:00
|
|
|
import Component from '@ember/component';
|
2022-02-01 12:34:03 +03:00
|
|
|
import classic from 'ember-classic-decorator';
|
2022-09-23 20:15:08 +03:00
|
|
|
import moment from 'moment-timezone';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {computed} from '@ember/object';
|
2022-02-01 12:34:03 +03:00
|
|
|
import {tagName} from '@ember-decorators/component';
|
2017-01-04 18:52:00 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@classic
|
|
|
|
@tagName('')
|
|
|
|
export default class GhUserActive extends Component {
|
|
|
|
user = null;
|
2015-06-13 17:34:09 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
@computed('user.lastLoginUTC')
|
|
|
|
get lastLoginUTC() {
|
2016-06-14 11:11:59 +03:00
|
|
|
let lastLoginUTC = this.get('user.lastLoginUTC');
|
2015-06-13 17:34:09 +03:00
|
|
|
|
2016-06-14 11:11:59 +03:00
|
|
|
return lastLoginUTC ? moment(lastLoginUTC).fromNow() : '(Never)';
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|
|
|
|
}
|