Update PostComponent.vue, use timeAgo util

pull/2147/head
Daniel Supernault 2020-04-26 02:49:28 -06:00
rodzic 46767810a4
commit c95dd26a79
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 1 dodań i 23 usunięć

Wyświetl plik

@ -1066,29 +1066,7 @@ export default {
},
timeAgo(ts) {
let date = Date.parse(ts);
let seconds = Math.floor((new Date() - date) / 1000);
let interval = Math.floor(seconds / 31536000);
if (interval >= 1) {
return interval + "y";
}
interval = Math.floor(seconds / 604800);
if (interval >= 1) {
return interval + "w";
}
interval = Math.floor(seconds / 86400);
if (interval >= 1) {
return interval + "d";
}
interval = Math.floor(seconds / 3600);
if (interval >= 1) {
return interval + "h";
}
interval = Math.floor(seconds / 60);
if (interval >= 1) {
return interval + "m";
}
return Math.floor(seconds) + "s";
return App.util.format.timeAgo(ts);
},
emojiReaction() {