added old label (> 3 months)

This commit is contained in:
Nicolas Constant 2019-06-17 21:49:18 -04:00
parent 8d5d6ae5d1
commit 0e214f1204
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
3 changed files with 14 additions and 0 deletions

View File

@ -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> -->

View File

@ -80,6 +80,9 @@
&--discuss {
background-color: rgb(90, 0, 143);
}
&--old {
background-color: rgb(150, 0, 0);
}
}
&__name {
display: inline-block;

View File

@ -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 {