mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
WebUI: use assignment operator shorthand
This commit is contained in:
parent
a19d623ead
commit
d7abeb4bf0
2 changed files with 4 additions and 3 deletions
|
@ -30,6 +30,7 @@ export default [
|
||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
"no-unused-vars": "off",
|
"no-unused-vars": "off",
|
||||||
"no-var": "error",
|
"no-var": "error",
|
||||||
|
"operator-assignment": "error",
|
||||||
"prefer-arrow-callback": "error",
|
"prefer-arrow-callback": "error",
|
||||||
"prefer-const": "error",
|
"prefer-const": "error",
|
||||||
"Stylistic/no-mixed-operators": [
|
"Stylistic/no-mixed-operators": [
|
||||||
|
|
|
@ -114,15 +114,15 @@ window.qBittorrent.Misc = (function() {
|
||||||
if (minutes < 60)
|
if (minutes < 60)
|
||||||
return "QBT_TR(%1m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(minutes));
|
return "QBT_TR(%1m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(minutes));
|
||||||
let hours = minutes / 60;
|
let hours = minutes / 60;
|
||||||
minutes = minutes % 60;
|
minutes %= 60;
|
||||||
if (hours < 24)
|
if (hours < 24)
|
||||||
return "QBT_TR(%1h %2m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(hours)).replace("%2", parseInt(minutes));
|
return "QBT_TR(%1h %2m)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(hours)).replace("%2", parseInt(minutes));
|
||||||
let days = hours / 24;
|
let days = hours / 24;
|
||||||
hours = hours % 24;
|
hours %= 24;
|
||||||
if (days < 365)
|
if (days < 365)
|
||||||
return "QBT_TR(%1d %2h)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(days)).replace("%2", parseInt(hours));
|
return "QBT_TR(%1d %2h)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(days)).replace("%2", parseInt(hours));
|
||||||
const years = days / 365;
|
const years = days / 365;
|
||||||
days = days % 365;
|
days %= 365;
|
||||||
return "QBT_TR(%1y %2d)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(years)).replace("%2", parseInt(days));
|
return "QBT_TR(%1y %2d)QBT_TR[CONTEXT=misc]".replace("%1", parseInt(years)).replace("%2", parseInt(days));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue