feat: [approvals] 근태신청 시작일에 시간 선택 기능 추가

- 근태신청(attendance_request) 선택 시 시작일 input을 datetime-local로 전환
- 라벨도 '시작일' → '시작일시'로 변경
- 휴가/사유서는 기존 date 유지
This commit is contained in:
김보곤
2026-03-06 17:44:27 +09:00
parent 43862e26c6
commit 47fcaaa3a3
2 changed files with 15 additions and 3 deletions

View File

@@ -707,10 +707,22 @@ function switchFormMode(formId) {
leaveContainer.style.display = '';
populateLeaveTypes(code);
const today = new Date().toISOString().slice(0, 10);
const startEl = document.getElementById('leave-start-date');
const endEl = document.getElementById('leave-end-date');
if (!startEl.value) startEl.value = today;
const startLabel = document.getElementById('leave-start-label');
// 근태신청은 시작일에 시간 선택 가능
if (code === 'attendance_request') {
startEl.type = 'datetime-local';
if (startLabel) startLabel.textContent = '시작일시';
if (!startEl.value) startEl.value = new Date().toISOString().slice(0, 16);
} else {
startEl.type = 'date';
if (startLabel) startLabel.textContent = '시작일';
if (!startEl.value) startEl.value = new Date().toISOString().slice(0, 10);
}
const today = new Date().toISOString().slice(0, 10);
if (!endEl.value) endEl.value = today;
} else if (code === 'employment_cert') {
isCertForm = true;

View File

@@ -36,7 +36,7 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-
{{-- 시작일 / 종료일 --}}
<div class="flex gap-4 flex-wrap">
<div style="flex: 1 1 200px; max-width: 300px;">
<label class="block text-sm font-medium text-gray-700 mb-1">시작일 <span class="text-red-500">*</span></label>
<label class="block text-sm font-medium text-gray-700 mb-1"><span id="leave-start-label">시작일</span> <span class="text-red-500">*</span></label>
<input type="date" id="leave-start-date"
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>