display years, fix #603

This commit is contained in:
Nicolas Constant 2023-08-12 17:05:25 -04:00
parent 10fa412173
commit 8703df27d5
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ export class TimeAgoPipe implements PipeTransform {
const hours = minutes / 60;
const days = hours / 24;
// const months = days / 30.416;
// const years = days / 365;
const years = days / 365;
if (seconds <= 59) {
text = Math.round(seconds) + 's';
@ -38,8 +38,10 @@ export class TimeAgoPipe implements PipeTransform {
text = Math.round(minutes) + 'm';
} else if (hours <= 23) {
text = Math.round(hours) + 'h';
} else {
} else if (days < 365) {
text = Math.round(days) + 'd';
} else {
text = Math.round(years) + 'y';
}
if (minutes < 1) {