feat: [approvals] 근태신청 시작일에 시간 선택 기능 추가
- 근태신청(attendance_request) 선택 시 시작일 input을 datetime-local로 전환 - 라벨도 '시작일' → '시작일시'로 변경 - 휴가/사유서는 기존 date 유지
This commit is contained in:
@@ -707,10 +707,22 @@ function switchFormMode(formId) {
|
|||||||
leaveContainer.style.display = '';
|
leaveContainer.style.display = '';
|
||||||
populateLeaveTypes(code);
|
populateLeaveTypes(code);
|
||||||
|
|
||||||
const today = new Date().toISOString().slice(0, 10);
|
|
||||||
const startEl = document.getElementById('leave-start-date');
|
const startEl = document.getElementById('leave-start-date');
|
||||||
const endEl = document.getElementById('leave-end-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;
|
if (!endEl.value) endEl.value = today;
|
||||||
} else if (code === 'employment_cert') {
|
} else if (code === 'employment_cert') {
|
||||||
isCertForm = true;
|
isCertForm = true;
|
||||||
|
|||||||
@@ -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 class="flex gap-4 flex-wrap">
|
||||||
<div style="flex: 1 1 200px; max-width: 300px;">
|
<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"
|
<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">
|
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>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user