Refactor in POO

This commit is contained in:
Tchi
2021-07-04 16:09:20 +02:00
parent fa0a0fc1aa
commit ae62ecc4bd
5 changed files with 71 additions and 50 deletions
+18
View File
@@ -0,0 +1,18 @@
function getTimeUrl() {
let time = 0;
if (!urlParams.has('seconds')
&& !urlParams.has('minutes')
&& !urlParams.has('hours')) {
time = 300
} else {
if (urlParams.has('seconds'))
time += parseInt(urlParams.get('seconds'));
if (urlParams.has('minutes'))
time += parseInt(urlParams.get('minutes')) * 60;
if (urlParams.has('hours'))
time += parseInt(urlParams.get('hours')) * 3600;
}
return time;
}