mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Merge pull request #1878 from Choromanski/feature/add-years-to-time-saved
Added years to time saved display
This commit is contained in:
@@ -1052,9 +1052,10 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
*/
|
*/
|
||||||
function getFormattedHours(minutes) {
|
function getFormattedHours(minutes) {
|
||||||
minutes = Math.round(minutes * 10) / 10;
|
minutes = Math.round(minutes * 10) / 10;
|
||||||
const days = Math.floor(minutes / 1440);
|
const years = Math.floor(minutes / 525600); // Assumes 365.0 days in a year
|
||||||
|
const days = Math.floor(minutes / 1440) % 365;
|
||||||
const hours = Math.floor(minutes / 60) % 24;
|
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);
|
return (years > 0 ? years + chrome.i18n.getMessage("yearAbbreviation") + " " : "") + (days > 0 ? days + chrome.i18n.getMessage("dayAbbreviation") + " " : "") + (hours > 0 ? hours + chrome.i18n.getMessage("hourAbbreviation") + " " : "") + (minutes % 60).toFixed(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function contentConfigUpdateListener(changes: StorageChangesObject) {
|
function contentConfigUpdateListener(changes: StorageChangesObject) {
|
||||||
|
|||||||
Reference in New Issue
Block a user