Skip to content

Instantly share code, notes, and snippets.

@stagfoo
Last active November 20, 2020 08:55
Show Gist options
  • Save stagfoo/29837d9439ad13ce11310ac0e34b688e to your computer and use it in GitHub Desktop.
Save stagfoo/29837d9439ad13ce11310ac0e34b688e to your computer and use it in GitHub Desktop.
jobcan.js
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