From 0e214f1204fa8897a242db84b3164800d9bc85d8 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Mon, 17 Jun 2019 21:49:18 -0400 Subject: [PATCH] added old label (> 3 months) --- src/app/components/stream/status/status.component.html | 3 +++ src/app/components/stream/status/status.component.scss | 3 +++ src/app/components/stream/status/status.component.ts | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/src/app/components/stream/status/status.component.html b/src/app/components/stream/status/status.component.html index 822c2377..a66f7b8c 100644 --- a/src/app/components/stream/status/status.component.html +++ b/src/app/components/stream/status/status.component.html @@ -63,6 +63,9 @@ *ngIf="hasReply"> replies +
+ old +
diff --git a/src/app/components/stream/status/status.component.scss b/src/app/components/stream/status/status.component.scss index 8468d751..c3cc54d7 100644 --- a/src/app/components/stream/status/status.component.scss +++ b/src/app/components/stream/status/status.component.scss @@ -80,6 +80,9 @@ &--discuss { background-color: rgb(90, 0, 143); } + &--old { + background-color: rgb(150, 0, 0); + } } &__name { display: inline-block; diff --git a/src/app/components/stream/status/status.component.ts b/src/app/components/stream/status/status.component.ts index 41462d29..5fbc73a7 100644 --- a/src/app/components/stream/status/status.component.ts +++ b/src/app/components/stream/status/status.component.ts @@ -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 {