mirror of
https://github.com/NicolasConstant/sengi
synced 2025-01-03 03:59:12 +01:00
display years, fix #603
This commit is contained in:
parent
10fa412173
commit
8703df27d5
@ -30,7 +30,7 @@ export class TimeAgoPipe implements PipeTransform {
|
|||||||
const hours = minutes / 60;
|
const hours = minutes / 60;
|
||||||
const days = hours / 24;
|
const days = hours / 24;
|
||||||
// const months = days / 30.416;
|
// const months = days / 30.416;
|
||||||
// const years = days / 365;
|
const years = days / 365;
|
||||||
|
|
||||||
if (seconds <= 59) {
|
if (seconds <= 59) {
|
||||||
text = Math.round(seconds) + 's';
|
text = Math.round(seconds) + 's';
|
||||||
@ -38,8 +38,10 @@ export class TimeAgoPipe implements PipeTransform {
|
|||||||
text = Math.round(minutes) + 'm';
|
text = Math.round(minutes) + 'm';
|
||||||
} else if (hours <= 23) {
|
} else if (hours <= 23) {
|
||||||
text = Math.round(hours) + 'h';
|
text = Math.round(hours) + 'h';
|
||||||
} else {
|
} else if (days < 365) {
|
||||||
text = Math.round(days) + 'd';
|
text = Math.round(days) + 'd';
|
||||||
|
} else {
|
||||||
|
text = Math.round(years) + 'y';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minutes < 1) {
|
if (minutes < 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user