-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutils.js
More file actions
33 lines (26 loc) · 775 Bytes
/
utils.js
File metadata and controls
33 lines (26 loc) · 775 Bytes
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
function getDate() {
let date = new Date();
let day = pad(date.getDate());
let month = pad(date.getMonth() + 1);
let year = date.getFullYear();
let hours = pad(date.getHours());
let minutes = pad(date.getMinutes());
let seconds = pad(date.getSeconds());
return `${month}_${day}_${year}-${hours}_${minutes}_${seconds}`;
}
function pad(value, padding = -2) {
return ('0' + value).slice(padding);
}
function showLoader(cb) {
document.querySelector('.overlayer-loader').classList.remove('__hidden');
if(cb) {
setTimeout(() => {
try {
cb()
} catch(err) {}
}, 200);
}
}
function hideLoader() {
document.querySelector('.overlayer-loader').classList.add('__hidden');
}