mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlock
This commit is contained in:
@@ -837,5 +837,13 @@
|
|||||||
},
|
},
|
||||||
"fillerNewFeature": {
|
"fillerNewFeature": {
|
||||||
"message": "New! Skip tangents and jokes with the filler category. Enable in options"
|
"message": "New! Skip tangents and jokes with the filler category. Enable in options"
|
||||||
|
},
|
||||||
|
"dayAbbreviation": {
|
||||||
|
"message": "d",
|
||||||
|
"description": "100d"
|
||||||
|
},
|
||||||
|
"hourAbbreviation": {
|
||||||
|
"message": "h",
|
||||||
|
"description": "100h"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -731,16 +731,17 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts time in minutes to 5h 25.1
|
* Converts time in minutes to 2d 5h 25.1
|
||||||
* If less than 1 hour, just returns minutes
|
* If less than 1 hour, just returns minutes
|
||||||
*
|
*
|
||||||
* @param {float} minutes
|
* @param {float} minutes
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function getFormattedHours(minutes) {
|
function getFormattedHours(minutes) {
|
||||||
minutes = Math.round(minutes * 10) / 10
|
minutes = Math.round(minutes * 10) / 10;
|
||||||
const hours = Math.floor(minutes / 60);
|
const days = Math.floor(minutes / 3600);
|
||||||
return (hours > 0 ? hours + "h " : "") + (minutes % 60).toFixed(1);
|
const hours = Math.floor(minutes / 60) % 24;
|
||||||
|
return (days > 0 ? days + chrome.i18n.getMessage("dayAbbreviation") + " " : "") + (hours > 0 ? hours + chrome.i18n.getMessage("hourAbbreviation") + " " : "") + (minutes % 60).toFixed(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//end of function
|
//end of function
|
||||||
|
|||||||
Reference in New Issue
Block a user