added old label (> 3 months)
This commit is contained in:
parent
8d5d6ae5d1
commit
0e214f1204
|
@ -63,6 +63,9 @@
|
|||
*ngIf="hasReply">
|
||||
replies
|
||||
</div>
|
||||
<div class="status__labels--label status__labels--old" title="this status is old" *ngIf="isOld">
|
||||
old
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div #content class="status__content" innerHTML="{{displayedStatus.content}}"></div> -->
|
||||
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
&--discuss {
|
||||
background-color: rgb(90, 0, 143);
|
||||
}
|
||||
&--old {
|
||||
background-color: rgb(150, 0, 0);
|
||||
}
|
||||
}
|
||||
&__name {
|
||||
display: inline-block;
|
||||
|
|
|
@ -30,6 +30,7 @@ export class StatusComponent implements OnInit {
|
|||
replyingToStatus: boolean;
|
||||
isCrossPoster: boolean;
|
||||
isThread: boolean;
|
||||
isOld: boolean;
|
||||
isContentWarned: boolean;
|
||||
hasReply: boolean;
|
||||
contentWarningText: string;
|
||||
|
@ -121,6 +122,13 @@ export class StatusComponent implements OnInit {
|
|||
}
|
||||
|
||||
this.hasReply = status.replies_count > 0;
|
||||
|
||||
let createdAt = new Date(status.created_at);
|
||||
let now = new Date();
|
||||
now.setMonth(now.getMonth() - 3);
|
||||
if (now > createdAt) {
|
||||
this.isOld = true;
|
||||
}
|
||||
}
|
||||
|
||||
openAccount(account: Account): boolean {
|
||||
|
|
Loading…
Reference in New Issue