Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
t-akira012 committed Jul 4, 2024
1 parent 4468b67 commit 9e69d61
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions generate_chosei_san.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
<body>
<div class="input-container">
<label for="year">年:</label>
<input type="number" id="year" value="2024">
<input type="number" id="year">
<label for="month">月:</label>
<input type="number" id="month" value="8"><br>
<input type="number" id="month"><br>
<label for="weekday-time">平日の開始時間:</label>
<input type="time" id="weekday-time" value="20:00">
<label for="weekend-times">週末の開始時間:</label>
<input type="time" id="weekend-time1" value="10:00">
<input type="time" id="weekend-time2" value="14:00">
<input type="time" id="weekend-time3" value="20:00"><br>
<button onclick="updateSchedule()">更新</button>
<button onclick="copyToClipboard()">コピー</button>
</div>

<div class="schedule">
<h2>スケジュール</h2>
<p>※ 祝日は対応してません。手入力してください。</p>
<textarea id="schedule-text" readonly></textarea>
</div>

Expand Down Expand Up @@ -90,8 +90,20 @@ <h2>スケジュール</h2>
displaySchedule(year, month, weekdayTime, weekendTimes);
}

// Initial display with default values
updateSchedule();
function copyToClipboard() {
const scheduleText = document.getElementById("schedule-text");
scheduleText.select();
document.execCommand("copy");
alert("スケジュールがクリップボードにコピーされました。");
}

// Set initial values to the current year and month
window.onload = function() {
const now = new Date();
document.getElementById("year").value = now.getFullYear();
document.getElementById("month").value = now.getMonth() + 1;
updateSchedule();
};
</script>
</body>
</html>

0 comments on commit 9e69d61

Please sign in to comment.