공무원 연가일수 계산기
재직기간과 가산·사용일수를 입력하면 국가공무원 기준 기본 연가와 잔여 연가를 바로 계산합니다.
입력값은 브라우저에서만 계산되며 서버로 전송되지 않습니다.
년개월
국가공무원 복무규정 제15조의 재직기간별 기본 연가일수입니다.
일
소속 기관에서 별도로 부여한 가산일수가 있으면 입력하세요.
일
잔여 연가
16일
기본 16일 + 가산 0일 − 사용 0일
- 기본 연가16일
- 가산0일
- 총 연가16일
- 사용0일
- 잔여16일
| 재직기간 | 기본 연가 |
|---|---|
| 1개월 이상 ~ 1년 미만 | 11일 |
| 1년 이상 ~ 3년 미만 | 15일 |
| 3년 이상 ~ 4년 미만 | 16일 |
| 4년 이상 ~ 5년 미만 | 17일 |
| 5년 이상 ~ 6년 미만 | 20일 |
| 6년 이상 | 21일 |
국가공무원 복무규정 제15조 기준의 기본 연가일수입니다. 연도 중 임용·휴직·정직, 지방공무원·교원·군인 등은 별도 규정과 소속 기관 지침을 확인하세요.
최근 입력0/8
입력이 3초간 멈추면 이 브라우저에 자동 저장됩니다.
입력이 3초간 멈추면 이 브라우저에만 저장됩니다. 항목을 클릭하면 그때의 입력값으로 복원됩니다.
이 도구는 이렇게 계산합니다
결과를 믿기 전에 계산 원리와 가정을 확인하세요.
- 국가공무원 복무규정 제15조의 재직기간별 기본 연가일수(1개월~1년 미만 11일, 1~3년 미만 15일, 3~4년 16일, 4~5년 17일, 5~6년 20일, 6년 이상 21일)를 적용합니다.
- 소속 기관의 가산일수와 이미 사용한 연가를 반영해 잔여 연가를 계산합니다.
- 연도 중 임용·휴직·정직, 지방공무원·교원·군인 등은 별도 규정을 확인해야 합니다.
자주 묻는 질문
연도 중 임용자도 계산할 수 있나요?
이 계산기는 재직기간 기준의 기본 연가일수를 계산합니다. 연도 중 임용·휴직·정직 등에 따른 월 단위 비례 산정은 소속 기관의 인사 기준을 확인해야 합니다.
지방공무원도 같은 기준인가요?
지방공무원은 지방공무원 복무규정을 적용받습니다. 국가공무원과 유사하지만 소속 기관의 최신 지침을 함께 확인하세요.
제작 코드
이 페이지에서 실제로 사용하는 Vue 3 컴포넌트입니다. 계산식과 화면 구성을 그대로 확인하고 복사할 수 있습니다.
도구 전체 코드 보기
<script setup lang="ts">
import { computed, ref } from 'vue'
import { fmt } from '~/utils/calc'
import CalculatorHistory from '~/components/calculators/CalculatorHistory.vue'
const years = ref(3)
const months = ref(0)
const extraDays = ref(0)
const usedDays = ref(0)
const totalMonths = computed(() => Math.max(0, (Number(years.value) || 0) * 12 + (Number(months.value) || 0)))
const baseDays = computed(() => {
if (totalMonths.value < 1) return 0
if (totalMonths.value < 12) return 11
if (totalMonths.value < 36) return 15
if (totalMonths.value < 48) return 16
if (totalMonths.value < 60) return 17
if (totalMonths.value < 72) return 20
return 21
})
const totalDays = computed(() => baseDays.value + (Number(extraDays.value) || 0))
const remaining = computed(() => Math.max(0, totalDays.value - (Number(usedDays.value) || 0)))
const historySnapshot = computed(() => ({
years: years.value,
months: months.value,
extraDays: extraDays.value,
usedDays: usedDays.value,
}))
const historyLabel = computed(() => `${years.value}년 ${months.value}개월 · 가산 ${extraDays.value}일 · 사용 ${usedDays.value}일`)
function restoreHistory(data: Record<string, unknown>) {
years.value = Number(data.years) || 0
months.value = Number(data.months) || 0
extraDays.value = Number(data.extraDays) || 0
usedDays.value = Number(data.usedDays) || 0
}
</script>
<template>
<div class="calc-card">
<div class="calc-grid">
<div class="calc-form">
<div class="calc-field">
<label for="leave-years">재직기간</label>
<div class="calc-inline">
<input id="leave-years" v-model.number="years" class="calc-input" type="number" min="0" step="1" inputmode="numeric" />
<span class="calc-unit">년</span>
<input v-model.number="months" class="calc-input" type="number" min="0" max="11" step="1" inputmode="numeric" aria-label="재직 개월" />
<span class="calc-unit">개월</span>
</div>
<p class="calc-hint">국가공무원 복무규정 제15조의 재직기간별 기본 연가일수입니다.</p>
</div>
<div class="calc-field">
<label for="leave-extra">가산 일수 (선택)</label>
<div class="calc-inline">
<input id="leave-extra" v-model.number="extraDays" class="calc-input" type="number" min="0" step="1" inputmode="numeric" />
<span class="calc-unit">일</span>
</div>
<p class="calc-hint">소속 기관에서 별도로 부여한 가산일수가 있으면 입력하세요.</p>
</div>
<div class="calc-field">
<label for="leave-used">이미 사용한 연가</label>
<div class="calc-inline">
<input id="leave-used" v-model.number="usedDays" class="calc-input" type="number" min="0" step="1" inputmode="numeric" />
<span class="calc-unit">일</span>
</div>
</div>
</div>
<div class="calc-result" aria-live="polite">
<p class="calc-result-label">잔여 연가</p>
<p class="calc-result-hero">{{ fmt(remaining, 0) }}일</p>
<p class="calc-result-sub">기본 {{ baseDays }}일 + 가산 {{ extraDays }}일 − 사용 {{ usedDays }}일</p>
<ul class="calc-result-list">
<li class="calc-result-row"><span>기본 연가</span><strong>{{ baseDays }}일</strong></li>
<li class="calc-result-row"><span>가산</span><strong>{{ fmt(extraDays, 0) }}일</strong></li>
<li class="calc-result-row"><span>총 연가</span><strong>{{ fmt(totalDays, 0) }}일</strong></li>
<li class="calc-result-row"><span>사용</span><strong>{{ fmt(usedDays, 0) }}일</strong></li>
<li class="calc-result-row total"><span>잔여</span><strong>{{ fmt(remaining, 0) }}일</strong></li>
</ul>
</div>
</div>
<div class="calc-table-wrap">
<table class="calc-table">
<caption class="sr-only">재직기간별 기본 연가일수</caption>
<thead><tr><th>재직기간</th><th>기본 연가</th></tr></thead>
<tbody>
<tr><td>1개월 이상 ~ 1년 미만</td><td>11일</td></tr>
<tr><td>1년 이상 ~ 3년 미만</td><td>15일</td></tr>
<tr><td>3년 이상 ~ 4년 미만</td><td>16일</td></tr>
<tr><td>4년 이상 ~ 5년 미만</td><td>17일</td></tr>
<tr><td>5년 이상 ~ 6년 미만</td><td>20일</td></tr>
<tr><td>6년 이상</td><td>21일</td></tr>
</tbody>
</table>
</div>
<p class="calc-note">
국가공무원 복무규정 제15조 기준의 기본 연가일수입니다. 연도 중 임용·휴직·정직, 지방공무원·교원·군인 등은 별도 규정과 소속 기관 지침을 확인하세요.
</p>
</div>
<CalculatorHistory tool="public-leave" :snapshot="historySnapshot" :label="historyLabel" @restore="restoreHistory" />
</template>
공통 입력 기록 컴포넌트 보기
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'
interface HistoryEntry {
id: string
at: number
label: string
data: Record<string, unknown>
}
const props = defineProps<{
tool: string
snapshot: Record<string, unknown>
label: string
}>()
const emit = defineEmits<{ restore: [data: Record<string, unknown>] }>()
const MAX_ENTRIES = 8
const SAVE_DELAY = 3000
const entries = ref<HistoryEntry[]>([])
const ready = ref(false)
const restoredId = ref('')
const storageKey = computed(() => `euninfo.calc-history.v1:${props.tool}`)
let saveTimer: ReturnType<typeof setTimeout> | undefined
let initialTimer: ReturnType<typeof setTimeout> | undefined
let initialSnapshot = ''
onMounted(() => {
load()
ready.value = true
// 부모의 onMounted 기본값 주입(날짜 등) 뒤에 초기 상태를 캡처한다.
initialTimer = setTimeout(() => {
initialSnapshot = JSON.stringify(props.snapshot)
}, 0)
})
onBeforeUnmount(() => {
if (saveTimer) clearTimeout(saveTimer)
if (initialTimer) clearTimeout(initialTimer)
})
watch(
() => props.snapshot,
() => {
if (!ready.value) return
if (saveTimer) clearTimeout(saveTimer)
saveTimer = setTimeout(save, SAVE_DELAY)
},
{ deep: true },
)
function load() {
try {
const raw = localStorage.getItem(storageKey.value)
if (!raw) return
const parsed: unknown = JSON.parse(raw)
if (!Array.isArray(parsed)) return
entries.value = parsed
.filter((item): item is HistoryEntry => {
if (!item || typeof item !== 'object') return false
const entry = item as Partial<HistoryEntry>
return typeof entry.id === 'string' && typeof entry.at === 'number' && typeof entry.label === 'string' && !!entry.data && typeof entry.data === 'object'
})
.slice(0, MAX_ENTRIES)
} catch {
entries.value = []
}
}
function persist() {
try {
localStorage.setItem(storageKey.value, JSON.stringify(entries.value))
} catch {
// 저장 공간이 없거나 브라우저가 막은 경우 조용히 무시한다.
}
}
function save() {
const data = JSON.parse(JSON.stringify(props.snapshot)) as Record<string, unknown>
const json = JSON.stringify(data)
if (!entries.value.length && json === initialSnapshot) return
const now = Date.now()
const label = props.label.trim() || '최근 입력'
const existing = entries.value.find((entry) => JSON.stringify(entry.data) === json)
if (existing) {
existing.at = now
existing.label = label
entries.value = [existing, ...entries.value.filter((entry) => entry.id !== existing.id)]
} else {
entries.value = [
{
id: `${now}-${Math.random().toString(36).slice(2, 8)}`,
at: now,
label,
data,
},
...entries.value,
].slice(0, MAX_ENTRIES)
}
persist()
}
function restore(entry: HistoryEntry) {
emit('restore', JSON.parse(JSON.stringify(entry.data)) as Record<string, unknown>)
restoredId.value = entry.id
setTimeout(() => {
if (restoredId.value === entry.id) restoredId.value = ''
}, 1500)
}
function remove(id: string) {
entries.value = entries.value.filter((entry) => entry.id !== id)
persist()
}
function clear() {
entries.value = []
try {
localStorage.removeItem(storageKey.value)
} catch {
// ignore
}
}
function formatTime(at: number) {
return new Intl.DateTimeFormat('ko-KR', {
month: 'numeric',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
}).format(new Date(at))
}
</script>
<template>
<section class="calc-history" aria-label="최근 입력 기록">
<div class="calc-history-head">
<strong>최근 입력</strong>
<span class="calc-history-count">{{ entries.length }}/{{ MAX_ENTRIES }}</span>
<button v-if="entries.length" type="button" class="calc-history-clear" @click="clear">전체 삭제</button>
</div>
<p v-if="!entries.length" class="calc-history-empty">
입력이 3초간 멈추면 이 브라우저에 자동 저장됩니다.
</p>
<ul v-else class="calc-history-list">
<li v-for="entry in entries" :key="entry.id" class="calc-history-row" :class="{ restored: restoredId === entry.id }">
<button type="button" class="calc-history-load" :aria-label="`${entry.label} 입력값 불러오기`" @click="restore(entry)">
<span class="calc-history-label">{{ entry.label }}</span>
<time class="calc-history-time">{{ formatTime(entry.at) }}</time>
</button>
<button type="button" class="calc-history-remove" :aria-label="`${entry.label} 기록 삭제`" @click="remove(entry.id)">×</button>
</li>
</ul>
<p class="calc-history-note">
입력이 3초간 멈추면 이 브라우저에만 저장됩니다. 항목을 클릭하면 그때의 입력값으로 복원됩니다.
</p>
</section>
</template>
함께 쓰면 좋은 도구
이런 계산기가 필요하세요?
의뢰 등록하기우리 업무에 맞는 계산기·관리 도구를 함께 만들 수 있습니다.
