Last active
November 20, 2020 08:55
-
-
Save stagfoo/29837d9439ad13ce11310ac0e34b688e to your computer and use it in GitHub Desktop.
jobcan.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sleep (time) { | |
return new Promise((resolve) => setTimeout(resolve, time)); | |
} | |
async function enterTime() { | |
// sleep time expects milliseconds | |
let startWork = "0900" | |
let lunchStart = "1200" | |
let lunchFinish = "1300" | |
let finishWork = "1800" | |
// Usage! | |
await sleep(500) | |
document.getElementById('ter_time').value = startWork; | |
document.getElementById('insert_button').click(); | |
await sleep(500) | |
document.getElementById('ter_time').value = lunchStart; | |
document.getElementById('insert_button').click(); | |
await sleep(500) | |
document.getElementById('ter_time').value = lunchFinish; | |
document.getElementById('insert_button').click(); | |
await sleep(500) | |
document.getElementById('ter_time').value = finishWork; | |
document.getElementById('insert_button').click(); | |
} | |
enterTime(); | |
//leave empty space at the end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment