LoginSignup
1
0

More than 1 year has passed since last update.

Bookmarkletで会社の勤怠登録を効率化する

Last updated at Posted at 2021-12-14

はじめに

「バイバイ タイムカード」、「マネーフォワードクラウド勤怠」... この世の中に星の数ほどある勤怠管理ツール。
皆様は何を使われおりますでしょうか。

私が勤める会社では「KING OF TIME」を使用しています。

KING OF TIMEの使い心地

KING OF TIMEの使い方は簡単です。以下の用に日付の一覧が並んでいるので、各日付を選択して入力するだけです。

  • 日付の一覧
    image.png

  • 勤怠入力画面
    image.png

ただし...

勤怠入力の欄は手入力しなければなりません。

私が働く時間は基本的に10時〜19時で毎日同じ。

テンプレートがほしい...

勤怠登録効率化スクリプト

ということで、スクリプトを書いて対応します。

以下のコードをBookmarkletに登録し、勤怠入力画面で実行します。

javascript: (function () { 
    let attendance = ['10:00', '19:00', '12:00', '13:00'];
    let i = 0;
    while(i < 4){
        document.getElementsByName(`recording_type_code_${i+1}`)[0].options[i+1].selected = true;
        timestamp = document.getElementById(`recording_timestamp_time_${i+1}`);
        timestamp.value = attendance[i];
        timestamp.focus();
        timestamp.blur();
        i++;
    };
    document.getElementById("recording_timestamp_time_1").focus();
    onClickActionButton('action_01');
}
)();

勤務時間に変更があるときはattendanceをいじります。

以上で完成です。

おわりに

あっさり終わってしまいましたが、最後までご覧いただきありがとうございました。
いいねと思った方はLGTMをいただけると幸いです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0