Skip to content

Date Picker ​

Calendar popover for selecting dates. For dates the user already knows, use DateInput instead.

Demo ​

Basic

ISO: (ingen)

With min/max

Kun datoer i december 2025

Pre-filled

Error

Disabled

Installation ​

vue
<script setup>
import { GTDatePicker } from '@grundtone/vue';
</script>

Usage ​

Basic ​

vue
<GTDatePicker v-model="date" label="Dato for aftale" />

With min/max ​

vue
<GTDatePicker v-model="date" label="Booking" min="2025-12-01" max="2025-12-31" />

With initial date ​

vue
<GTDatePicker v-model="date" label="Start" initial-date="2025-12-01" />

Props ​

PropTypeDefaultDescription
modelValuestring''ISO date YYYY-MM-DD (v-model)
labelstring—Label
helpTextstring—Help text
errorTextstring—Error message
placeholderstring'DD/MM/ÅÅÅÅ'Placeholder
formatstring'DD/MM/YYYY'Display format
minstring—Earliest date (ISO)
maxstring—Latest date (ISO)
initialDatestring—Calendar starts at this month
disabledbooleanfalseDisabled
requiredbooleanfalseRequired
localestring'da'Locale for names

Events ​

EventPayloadDescription
update:modelValuestringISO date selected

Calendar utilities ​

Available from @grundtone/utils:

ts
import { getCalendarGrid, formatDate, parseDate, getMonthNames, getWeekdayNames } from '@grundtone/utils';

DatePicker vs DateInput ​

Use DatePicker for booking/scheduling. Use DateInput for known dates (birth date, passport).