mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-14 07:27:05 +03:00
Add hours to popup time
This commit is contained in:
17
src/popup.ts
17
src/popup.ts
@@ -396,7 +396,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
extraInfo = " (" + chrome.i18n.getMessage("hiddenDueToDuration") + ")";
|
extraInfo = " (" + chrome.i18n.getMessage("hiddenDueToDuration") + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
sponsorTimeButton.innerText = prefix + getFormattedTime(segmentTimes[i].segment[0]) + " " + chrome.i18n.getMessage("to") + " " + getFormattedTime(segmentTimes[i].segment[1]) + extraInfo;
|
sponsorTimeButton.innerText = prefix + utils.getFormattedTime(segmentTimes[i].segment[0], true) + " " + chrome.i18n.getMessage("to") + " " + utils.getFormattedTime(segmentTimes[i].segment[1], true) + extraInfo;
|
||||||
|
|
||||||
const categoryColorCircle = document.createElement("span");
|
const categoryColorCircle = document.createElement("span");
|
||||||
categoryColorCircle.id = "sponsorTimesCategoryColorCircle" + UUID;
|
categoryColorCircle.id = "sponsorTimesCategoryColorCircle" + UUID;
|
||||||
@@ -595,21 +595,6 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//converts time in seconds to minutes:seconds
|
|
||||||
function getFormattedTime(seconds) {
|
|
||||||
const minutes = Math.floor(seconds / 60);
|
|
||||||
const secondsDisplayNumber = seconds - minutes * 60;
|
|
||||||
let secondsDisplay = secondsDisplayNumber.toFixed(3);
|
|
||||||
if (secondsDisplayNumber < 10) {
|
|
||||||
//add a zero
|
|
||||||
secondsDisplay = "0" + secondsDisplay;
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatted = minutes + ":" + secondsDisplay;
|
|
||||||
|
|
||||||
return formatted;
|
|
||||||
}
|
|
||||||
|
|
||||||
function whitelistChannel() {
|
function whitelistChannel() {
|
||||||
//get the channel url
|
//get the channel url
|
||||||
messageHandler.query({
|
messageHandler.query({
|
||||||
|
|||||||
Reference in New Issue
Block a user