clean up since the pipe is now handling that
This commit is contained in:
parent
6af023fbbd
commit
b876728dbe
@ -80,23 +80,23 @@ export class StatusComponent implements OnInit {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
getCompactRelativeTime(d: string): string {
|
// getCompactRelativeTime(d: string): string {
|
||||||
const date = (new Date(d)).getTime();
|
// const date = (new Date(d)).getTime();
|
||||||
const now = Date.now();
|
// const now = Date.now();
|
||||||
const timeDelta = (now - date) / (1000);
|
// const timeDelta = (now - date) / (1000);
|
||||||
|
|
||||||
if (timeDelta < 60) {
|
// if (timeDelta < 60) {
|
||||||
return `${timeDelta | 0}s`;
|
// return `${timeDelta | 0}s`;
|
||||||
} else if (timeDelta < 60 * 60) {
|
// } else if (timeDelta < 60 * 60) {
|
||||||
return `${timeDelta / 60 | 0}m`;
|
// return `${timeDelta / 60 | 0}m`;
|
||||||
} else if (timeDelta < 60 * 60 * 24) {
|
// } else if (timeDelta < 60 * 60 * 24) {
|
||||||
return `${timeDelta / (60 * 60) | 0}h`;
|
// return `${timeDelta / (60 * 60) | 0}h`;
|
||||||
} else if (timeDelta < 60 * 60 * 24 * 31) {
|
// } else if (timeDelta < 60 * 60 * 24 * 31) {
|
||||||
return `${timeDelta / (60 * 60 * 24) | 0}d`;
|
// return `${timeDelta / (60 * 60 * 24) | 0}d`;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return formatDate(date, 'MM/dd', this.locale);
|
// return formatDate(date, 'MM/dd', this.locale);
|
||||||
}
|
// }
|
||||||
|
|
||||||
openReply(): boolean {
|
openReply(): boolean {
|
||||||
this.replyingToStatus = !this.replyingToStatus;
|
this.replyingToStatus = !this.replyingToStatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user