mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-04 12:44:57 +03:00
37 lines
863 B
JavaScript
37 lines
863 B
JavaScript
|
import Component from '@glimmer/component';
|
||
|
import {action} from '@ember/object';
|
||
|
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
import {tracked} from '@glimmer/tracking';
|
||
|
|
||
|
export default class PostsListItemClicks extends Component {
|
||
|
@service feature;
|
||
|
@service session;
|
||
|
@service settings;
|
||
|
|
||
|
@tracked isHovered = false;
|
||
|
|
||
|
get scheduledText() {
|
||
|
let {post} = this.args;
|
||
|
let text = [];
|
||
|
|
||
|
let formattedTime = formatPostTime(
|
||
|
post.publishedAtUTC,
|
||
|
{timezone: this.settings.get('timezone'), scheduled: true}
|
||
|
);
|
||
|
text.push(formattedTime);
|
||
|
|
||
|
return text.join(' ');
|
||
|
}
|
||
|
|
||
|
@action
|
||
|
mouseOver() {
|
||
|
this.isHovered = true;
|
||
|
}
|
||
|
|
||
|
@action
|
||
|
mouseLeave() {
|
||
|
this.isHovered = false;
|
||
|
}
|
||
|
}
|