Skip to content

Calendar

A container for displaying data in calendar form.

When to Use

Use when you need to display a set of data in calendar form, or let users select a date.

Basic Usage

Use v-model for date selection. Default week starts on Monday.

vue

<TCalendar v-model="selectedDate" />

Controlled Mode

Pass a preset value and the calendar will automatically highlight the corresponding date.

vue

const presetDate = ref('2026-06-01')
<TCalendar v-model="presetDate" />

Show Week Numbers

Set show-week to display ISO week numbers on the left column.

vue

<TCalendar show-week />

Auto Switch Month

Click on dates from previous or next month (shown in gray), and the calendar will automatically navigate to that month and select the date.

vue

<TCalendar v-model="selectedDate" />

Custom First Day of Week

Set first-day-of-week="0" to start the week on Sunday.

vue

<TCalendar :first-day-of-week="0" show-week />

Range Restriction

Use min and max to restrict selectable date range.

vue

<TCalendar min="2026-01-01" max="2026-01-31" />

Custom Disabled Dates

Use disabled-date prop to dynamically control which dates are disabled.

vue

const isWeekend = (date) => {
  const d = new Date(date);
  return d.getDay() === 0 || d.getDay() === 6;
}
<TCalendar :disabled-date="isWeekend" />

Range Selection

Set range to enable range selection mode. Use v-model:range-start and v-model:range-end for two-way binding. Click the first date as start, then the second as end. A third click starts a new range.

vue

const rangeStart = ref('2026-01-01')
const rangeEnd = ref('2026-01-14')

<TCalendar
  range
  v-model:range-start="rangeStart"
  v-model:range-end="rangeEnd"
/>

Internationalization

Pass a custom locale object to fully customize week day names, month names, button text, and year format.

vue

const enLocale = {
  weekDays: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  months: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  today: 'Back to Today',
  week: 'Wk',
  yearFormat: '{y}',
  prevMonth: 'Prev Month',
  nextMonth: 'Next Month',
  prevYear: 'Prev Year',
  nextYear: 'Next Year',
}

<TCalendar :locale="enLocale" show-week />

Fullscreen Mode

Set fullscreen to enable large-size calendar, suitable for embedding in page content areas.

vue

<TCalendar fullscreen />

Mini Mode

Set mini for a compact layout. No content area, centered core info, smaller spacing. Ideal for sidebars, cards, and small spaces.

vue

<TCalendar mini />
<TCalendar mini show-week />
<TCalendar mini mode="year" />

Lock View

Set lockView to freeze the current view mode. Hides the mode switch buttons. Clicking a month in year view navigates without switching views.

vue

<TCalendar lockView="y" mini />

Hide View Switch

Set show-view-switch to false to hide the view switch buttons.

vue

<TCalendar :show-view-switch="false" />

Week Select Mode

Set week-select to enable week selection. Click any date to select the entire week. The v-model value uses ISO week format (e.g., 2026-W29).

vue

<TCalendar week-select show-week />

Custom Week Format

Use week-format to customize the value format. Supports {y} (year) and {wk} (week number) placeholders.

vue

<TCalendar week-select week-format="W{wk}-{y}" show-week />

Read-Only Mode

Set readonly to disable all selection operations. Ideal for displaying confirmed dates, weeks, or months.

vue

<TCalendar :model-value="'2026-06-01'" readonly />
<TCalendar :model-value="'2026-06-01'" readonly mode="year" />
<TCalendar week-select readonly week-format="W{wk}-{y}" show-week />

API

TCalendar Props

PropDescriptionTypeDefault
model-valueSelected date (v-model, format YYYY-MM-DD)string | nullnull
minMinimum selectable datestringundefined
maxMaximum selectable datestringundefined
first-day-of-weekFirst day of week: 0=Sunday, 1=Monday0 | 11
disabled-dateCustom disabled date function(date: string) => booleanundefined
fullscreenFullscreen/large modebooleanfalse
show-weekShow ISO week number columnbooleanfalse
rangeEnable range selection modebooleanfalse
range-startRange start date (v-model:range-start)string | nullnull
range-endRange end date (v-model:range-end)string | nullnull
modeView mode'year' | 'month' | 'week''month'
localeInternationalization configCalendarLocaledefaultLocale
lock-viewLock view: y=year, m=month, w=week'y' | 'm' | 'w'undefined
show-view-switchShow view switch buttonsbooleantrue
miniMini mode (no content area, centered)booleanfalse
week-selectEnable week selection modebooleanfalse
week-formatWeek value format templatestring'{y}-W{wk}'
readonlyRead-only mode (disable selection)booleanfalse

TCalendar Events

EventDescriptionParameters
update:model-valueSingle mode date changed(value: string) => void
update:modeView mode changed(value: 'year' | 'month' | 'week') => void
update:range-startRange start changed(value: string | null) => void
update:range-endRange end changed(value: string | null) => void
changeDate selected(value: string | { start, end }) => void
panel-changePanel year/month changed(year: number, month: number) => void

TCalendar Slots

SlotDescriptionScoped Props
cellFully customize the entire cell{ day: CalendarDay }: date, day, isCurrentMonth, isToday, isSelected, isDisabled, weekNumber, isRangeStart, isRangeEnd, isInRange
cell-contentCustomize the inner content area (works in year/month/week views){ cell: CalendarDay | CalendarMonthCell | CalendarWeekDay, mode: 'year' | 'month' | 'week' }

TCalendar Exposed Methods

MethodDescriptionParameters
goToDateNavigate to specific year/month(year: number, month?: number)
goToTodayNavigate back to today-
currentYearCurrent display year (readonly)-
currentMonthNumCurrent display month 1-12 (readonly)-
resetRangeReset range selection state-