mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Fix time formatting, again
This commit is contained in:
@@ -880,22 +880,22 @@ export function formatSecondsToTimeAgo(secs) {
|
|||||||
const days = Math.floor(hours / 24);
|
const days = Math.floor(hours / 24);
|
||||||
|
|
||||||
if (seconds < 60) {
|
if (seconds < 60) {
|
||||||
if (seconds <= 1) {
|
if (seconds === 1) {
|
||||||
return T.global.time.oneSecondAgo;
|
return T.global.time.oneSecondAgo;
|
||||||
}
|
}
|
||||||
return T.global.time.xSecondsAgo.replace("<x>", "" + seconds);
|
return T.global.time.xSecondsAgo.replace("<x>", "" + seconds);
|
||||||
} else if (minutes < 60) {
|
} else if (minutes < 60) {
|
||||||
if (minutes <= 1) {
|
if (minutes === 1) {
|
||||||
return T.global.time.oneMinuteAgo;
|
return T.global.time.oneMinuteAgo;
|
||||||
}
|
}
|
||||||
return T.global.time.xMinutesAgo.replace("<x>", "" + minutes);
|
return T.global.time.xMinutesAgo.replace("<x>", "" + minutes);
|
||||||
} else if (hours < 24) {
|
} else if (hours < 24) {
|
||||||
if (hours <= 1) {
|
if (hours === 1) {
|
||||||
return T.global.time.oneHourAgo;
|
return T.global.time.oneHourAgo;
|
||||||
}
|
}
|
||||||
return T.global.time.xHoursAgo.replace("<x>", "" + hours);
|
return T.global.time.xHoursAgo.replace("<x>", "" + hours);
|
||||||
} else {
|
} else {
|
||||||
if (days <= 1) {
|
if (days === 1) {
|
||||||
return T.global.time.oneDayAgo;
|
return T.global.time.oneDayAgo;
|
||||||
}
|
}
|
||||||
return T.global.time.xDaysAgo.replace("<x>", "" + days);
|
return T.global.time.xDaysAgo.replace("<x>", "" + days);
|
||||||
|
|||||||
Reference in New Issue
Block a user