mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
WebUI: use static method for getting time
Unify API usage across the code base.
This commit is contained in:
parent
fef6ac515c
commit
599a040462
2 changed files with 2 additions and 2 deletions
|
@ -1501,7 +1501,7 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
td.title = "∞";
|
||||
}
|
||||
else {
|
||||
const formattedVal = "QBT_TR(%1 ago)QBT_TR[CONTEXT=TransferListDelegate]".replace("%1", window.qBittorrent.Misc.friendlyDuration((new Date() / 1000) - val));
|
||||
const formattedVal = "QBT_TR(%1 ago)QBT_TR[CONTEXT=TransferListDelegate]".replace("%1", window.qBittorrent.Misc.friendlyDuration((Date.now() / 1000) - val));
|
||||
td.textContent = formattedVal;
|
||||
td.title = formattedVal;
|
||||
}
|
||||
|
|
|
@ -767,7 +767,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
|||
|
||||
// calculate days since last match
|
||||
if (rulesList[ruleName].lastMatch !== "") {
|
||||
const timeDiffInMs = new Date().getTime() - new Date(rulesList[ruleName].lastMatch).getTime();
|
||||
const timeDiffInMs = Date.now() - new Date(rulesList[ruleName].lastMatch).getTime();
|
||||
const daysAgo = Math.floor(timeDiffInMs / (1000 * 60 * 60 * 24)).toString();
|
||||
document.getElementById("lastMatchText").textContent = " QBT_TR(Last Match: %1 days ago)QBT_TR[CONTEXT=AutomatedRssDownloader]".replace("%1", daysAgo);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue