-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cron.html
49 lines (44 loc) · 1.69 KB
/
Cron.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="dbUI-Cron.css">
</head>
<body>
<div class="dbUI-cron" old="">
<input class="cron-input" id="cronBtn" type="text">
<a class="cron-select">Cron</a>
<a class="cron-clear">重置</a>
<a class="cron-analytice" onclick="CronAnalytice()">解析</a>
<div class="cron-config" id="config">
</div>
</div>
<div id="contanier">
</div>
<script src="dbUI-Cron.js"></script>
<script src="CronAnaly.js"></script>
<script>
function CronAnalytice() {
let input = document.getElementById("cronBtn");
let config = document.getElementById("config");
let dates = $db.CronAnalytice(input.value, new Date());
let contanier = document.getElementById("contanier");
contanier.innerHTML = "";
if (config.classList.contains("show")) config.classList.remove("show");
for (let index = 0; index < dates.length; index++) {
const element = new Date(dates[index]);
$db.ctElement({
p: contanier,
e: "p",
t: `${element.getFullYear()}-${fillZero(element.getMonth() + 1, 2)}-${fillZero(element.getDate(), 2)} ${fillZero(element.getHours(), 2)}:${fillZero(element.getMinutes(), 2)}:${fillZero(element.getSeconds(), 2)}`
});
}
function fillZero(num, m) {
return (Array(m).join(0) + num).slice(-m);
}
}
</script>
</body>
</html>