Skip to content
On this page

API

Props

Prop Support

VDatePicker accepts all the same props as VCalendar.

NameTypeDefault
mode'date' | 'dateTime' | 'time''date'
model-valueDatePickerDatenull
rules'auto' | DatePartsRulesundefined
is-requiredbooleanfalse
is24hrbooleantrue
hide-time-headerbooleanfalse
time-accuracynumber2
update-on-inputbooleantrue
input-debouncenumber1000
popovertrue | Partial<PopoverOptions>true
drag-attributeAttributeConfigundefined
select-attributeAttibuteConfigundefined

Events

Event Support

VDatePicker emits all the same events as Calendar.

EventParameter Type
update:modelValueDatePickerDate
dragSimpleDateRange | null
popover-will-showHTMLElement
popover-did-showHTMLElement
popover-will-hideHTMLElement
popover-did-hideHTMLElement

Slots

Event Support

VDatePicker supports all the same slots as Calendar.

NameProps
defaultDatePickerContext
time-header

Types

DatePickerDate

ts
type DatePickerDate = number | string | Date | null | {
  start?: number | string | Date | null,
  end?: number | string | Date | null
}

SimpleDateRange

ts
{
  start: Date;
  end: Date;
}

ModelModifiers

ts
interface ModelModifiers {
  number?: boolean;
  string?: boolean;
  range?: boolean;
}

DatePartsRules

ts
interface DatePartsRules {
  hours?: DatePartsRule;
  minutes?: DatePartsRule;
  seconds?: DatePartsRule;
  milliseconds?: DatePartsRule;
}

type DatePartsRule =
  | number
  | Array<number>
  | NumberRuleConfig
  | DatePartsRuleFunction;

interface NumberRuleConfig {
  min?: number;
  max?: number;
  interval?: number;
}

PopoverOptions

ts
interface PopoverOptions {
  visibility: PopoverVisibility; // When the popover appears
  placement: Placement; // Where the popover appears
  autoHide: boolean; // Auto-hide popover based on visibility
  showDelay: number; // Delay (ms) before popover is shown
  hideDelay: number; // Delay (ms) before popover is hidden
}

type PopoverVisibility = 'click' | 'hover' | 'hover-focus' | 'focus';

Released under the MIT License.