refactor: remove unused
This commit is contained in:
1 parent
f208d718ad
commit
34840bc4a2
2 files changed
+1
-40
No files matched your search
+1
-36
@@ -14,39 +14,4 @@ function now() {
|
||||
return now.getHours() * 3600 + now.getMinutes() * 60 + now.getSeconds()
|
||||
}
|
||||
|
||||
function isPrzerwa() {
|
||||
let s = now()
|
||||
|
||||
return seconds.some(([start, end]) => s > start && s < end)
|
||||
}
|
||||
|
||||
function getPrzerwa() {
|
||||
let s = now()
|
||||
|
||||
return seconds.findIndex(([start, end]) => s > start && s < end)
|
||||
}
|
||||
|
||||
function howPrzerwa() {
|
||||
let s = now(),
|
||||
n = getPrzerwa(),
|
||||
[start, end] = seconds[n]
|
||||
|
||||
console.log(s, n)
|
||||
|
||||
return [s - start, end - s, end - start]
|
||||
}
|
||||
|
||||
function untilPrzerwa() {
|
||||
if (!isPrzerwa()) {
|
||||
let s = now(),
|
||||
n = seconds.findIndex(([begin, end], i, me) => {
|
||||
let last = me[i - 1]
|
||||
|
||||
return s < begin && s > (last ? last[1] : 0)
|
||||
})
|
||||
if (n === -1) return -1
|
||||
return seconds[n][0] - s
|
||||
} else return 0
|
||||
}
|
||||
|
||||
export { now, isPrzerwa, getPrzerwa, howPrzerwa, untilPrzerwa }
|
||||
export { now }
|
||||
@@ -19,8 +19,4 @@ export default [
|
||||
[12, 30],
|
||||
[12, 40],
|
||||
],
|
||||
[
|
||||
[13, 25],
|
||||
[13, 30],
|
||||
],
|
||||
]
|
||||
Reference in new issue
Block a user