Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oieioi/6481cd08d4e7a1b74eaa8d5232edebd5 to your computer and use it in GitHub Desktop.
Save oieioi/6481cd08d4e7a1b74eaa8d5232edebd5 to your computer and use it in GitHub Desktop.
マネフォクラウドの勤怠一括入力
// ==UserScript==
// @name MoneyForward 勤務時間一括入力ボタン
// @namespace http://tampermonkey.net/
// @version 0.1
// @description MoneyForward 勤務時間一括入力ボタン
// @author You
// @match https://payroll.moneyforward.com/my/multiple_timesheet_employee_daily_records/edit
// @grant none
// ==/UserScript==
(function() {
'use strict';
const inputAll = () => {
const start = prompt('始業時間は?(初期値: 10:00)') || '10:00';
const end = prompt('就業時間は?(初期値: 19:00)') || '19:00';
$('#js-multiple-timesheet-employee-daily-records-table tr').each((i, e)=>{
if (!//.test(e.textContent)) return;
$('.add_fields',e).click();
$('[name*="elapsed_minutes_at_work_in_with_neuminour_string_format"]', e)[0].value = start;
$('[name*="elapsed_minutes_at_work_out_with_neuminour_string_format"]', e)[0].value = end;
})
}
const button = $('<button>🦑 一括入力 😎</button>').click(inputAll);
$('.payrolls-this-month').append(button);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment