rpc customisation settings page

This commit is contained in:
Core 2022-04-14 14:37:21 +01:00
parent 99b4c2960c
commit 5a2229cf67
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -1507,10 +1507,9 @@ const app = new Vue({
*/ */
convertTime(seconds, format = "short") { convertTime(seconds, format = "short") {
if (isNaN(seconds) || seconds == Infinity) { if (isNaN(seconds) || seconds === Infinity) {
seconds = 0 seconds = 0
} }
seconds = parseInt(seconds);
const datetime = new Date(seconds * 1000) const datetime = new Date(seconds * 1000)
@ -1520,12 +1519,11 @@ const app = new Vue({
const m = Math.floor(seconds % 3600 / 60); const m = Math.floor(seconds % 3600 / 60);
const s = Math.floor(seconds % 60); const s = Math.floor(seconds % 60);
const dDisplay = d > 0 ? `${d} ${app.getLz("term.time.day", { "count": d })}, ` : ""; const dDisplay = d > 0 ? `${d} ${app.getLz("term.time.day", { "count": d })}` : "";
const hDisplay = h > 0 ? `${h} ${app.getLz("term.time.hour", { "count": h })}, ` : ""; const hDisplay = h > 0 ? `${h} ${app.getLz("term.time.hour", { "count": h })}` : "";
const mDisplay = m > 0 ? `${m} ${app.getLz("term.time.minute", { "count": m })}, ` : ""; const mDisplay = m > 0 ? `${m} ${app.getLz("term.time.minute", { "count": m })}` : "";
const sDisplay = s > 0 ? `${s} ${app.getLz("term.time.second", { "count": s })}` : "";
return dDisplay + hDisplay + mDisplay + sDisplay; return dDisplay + (dDisplay && hDisplay ? ", " : "") + hDisplay + (hDisplay && mDisplay ? ", " : "") + mDisplay;
} }
else { else {
let returnTime = datetime.toISOString().substring(11, 19); let returnTime = datetime.toISOString().substring(11, 19);