Commit 3587fd23 authored by Ben Hayward's avatar Ben Hayward

Reintroducing scheduled post indicator on activity posts #3108

parent 295acdbc
Pipeline #150870705 failed with stages
in 44 minutes and 20 seconds
......@@ -11,6 +11,14 @@
*ngIf="service.isRemind$ | async"
>repeat</i
>
<m-tooltip
class="m-activityOwnerBlock__scheduledTooltip"
*ngIf="isScheduled()"
icon="schedule"
i18n
>
Scheduled for posting at: {{ toReadableDate(entity.time_created) }}
</m-tooltip>
<strong [title]="displayName">{{ displayName }}</strong>
<m-channel--badges
class="m-channel--badges-activity"
......
......@@ -54,6 +54,17 @@ m-activity__ownerBlock {
text-overflow: ellipsis;
overflow: hidden;
}
.m-activityOwnerBlock__scheduledTooltip {
i {
padding-right: 4px;
font-size: 20px;
@include m-theme() {
color: themed($m-blue);
}
}
}
}
.m-activityOwnerBlock__groupName {
......
......@@ -80,4 +80,22 @@ export class ActivityOwnerBlockComponent implements OnInit, OnDestroy {
? this.entity.containerObj
: null;
}
/**
* determines whether the post is scheduled.
* @returns true if post is scheduled.
*/
isScheduled(): boolean {
return (
this.entity.time_created && this.entity.time_created * 1000 > Date.now()
);
}
/**
* Converts a date to a human readable datetime e.g. 29/05/2020, 10:32:46.
* @returns - human readable datetime.
*/
toReadableDate(seconds: string): string {
return new Date(parseInt(seconds) * 1000).toLocaleString();
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment