average time to block calc

This commit is contained in:
Benjamin Wilson
2024-08-22 10:31:37 -04:00
parent 3f7603ec99
commit 74f9d2e8c4
8 changed files with 68 additions and 19 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ export class DateAgoPipe implements PipeTransform {
transform(value: any, args?: any): any {
if (value) {
const seconds = Math.floor((+new Date() - +new Date(value)) / 1000);
const seconds = Math.abs(Math.floor((+new Date() - +new Date(value)) / 1000));
if (seconds < 29) // less than 30 seconds ago will show as 'Just now'
return 'Just now';
const intervals: { [key: string]: number } = {