rpc customisation settings page
This commit is contained in:
parent
99b4c2960c
commit
5a2229cf67
1 changed files with 5 additions and 7 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue