Skip to content

Instantly share code, notes, and snippets.

@creasty
Last active October 5, 2023 03:12
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creasty/952a7fb0e532ea0d0d9297d15f443775 to your computer and use it in GitHub Desktop.
Save creasty/952a7fb0e532ea0d0d9297d15f443775 to your computer and use it in GitHub Desktop.
Jobcan で埋まっていないところを勝手に埋めてくれるくん
document.querySelectorAll('tr[id^=tr_line_of_]').forEach(el => {
const start = el.querySelector('input[name^=start]');
const end = el.querySelector('input[name^=end]');
const button = el.querySelector('.btn');
const holiday = el.querySelector('#uneditable_holiday');
if (!!start.value && !!end.value) {
return;
}
if (holiday.innerText.match(/休/)) {
return;
}
if (!!start.value && start.value >= '17:00') {
end.value = start.value;
start.value = '';
}
start.value = start.value || '10:30';
end.value = end.value || '19:00';
cellBlur(start);
cellBlur(end);
button.click();
});
@creasty
Copy link
Author

creasty commented Oct 31, 2019

  • https://ssl.jobcan.jp/employee/attendance/edit で実行して使います。
  • 退勤だけつけて、退勤時間が出勤時間に入っているケースに対応しています。
  • 法休、公休にも対応しています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment