Skip to content

[Integration] Convert Vuetify to use @vuetify/0 useDate #111

@johnleider

Description

@johnleider

Summary

Migrate Vuetify's date system to use @vuetify/v0's useDate under the hood, following the same pattern as the locale migration (vuetifyjs/vuetify#22753) and theme migration (vuetifyjs/vuetify#22765).

Decision: Option A — v0-native adapters for popular date libraries

v0 owns the runtime date adapter interface and ships a Temporal-based default adapter. Vuetify provides bridge adapters for the existing ecosystem (dayjs, luxon, date-fns, moment) so users don't need to change their date library.

v0 owns:

  • useDate composable and DateAdapter interface
  • Temporal-based default adapter (Vuetify0DateAdapter)
  • Date arithmetic, formatting, locale sync, calendar helpers
  • Plugin/context pattern (createDatePlugin, useDate)

Vuetify provides (NOT in v0):

  • Bridge adapters for dayjs, luxon, date-fns, moment
  • These wrap the existing date-io adapters to conform to v0's DateAdapter interface
  • Migration path from current date-io setup
  • VDatePicker, VTimePicker integration

Feature Parity Analysis

v0's DateAdapter is a superset of Vuetify's — every Vuetify method exists in v0, plus ~15 additional methods. No methods need to be added to v0.

Methods at parity (no changes needed)

Category Methods
Construction date(), toJsDate(), parseISO(), toISO()
Arithmetic addMinutes(), addHours(), addDays(), addWeeks(), addMonths()
Comparison isAfter(), isAfterDay(), isBefore(), isEqual(), isSameDay(), isSameMonth(), isSameYear(), isWithinRange()
Getters getYear(), getMonth(), getDate(), getHours(), getMinutes(), getDiff()
Setters setYear(), setMonth(), setDate(), setHours(), setMinutes()
Navigation startOfDay(), endOfDay(), startOfMonth(), endOfMonth(), startOfYear(), endOfYear(), getNextMonth(), getPreviousMonth()
Formatting format()
Validation isValid()

v0 extras (not in Vuetify — preserved, not needed for migration)

addSeconds(), addYears(), getSeconds(), setSeconds(), isAfterMonth(), isAfterYear(), isBeforeDay(), isBeforeMonth(), isBeforeYear(), isSameHour(), getDaysInMonth(), getMonthArray(), getYearRange(), mergeDateAndTime(), formatByString(), getFormatHelperText(), formatNumber(), getMeridiemText(), getCurrentLocaleCode(), is12HourCycleInCurrentLocale(), isNull(), parse()

Critical incompatibilities (must resolve)

Issue v0 Vuetify Resolution
firstDayOfWeek Adapter property Method parameter Vuetify wrapper sets property before delegating
getWeek signature (date, minimalDays?) (date, firstDayOfWeek?, firstDayOfYear?) Vuetify wrapper translates params
startOfWeek signature (date) (date, firstDayOfWeek?) Vuetify wrapper sets property before delegating
getWeekdays signature (weekdayFormat?) (firstDayOfWeek?, weekdayFormat?) Vuetify wrapper sets property before delegating
getWeekArray signature (date) (date, firstDayOfWeek?) Vuetify wrapper sets property before delegating
isValid return Type predicate date is T boolean Compatible (predicate is a boolean)

VDatePicker actual usage (methods the migration MUST support)

date(), isValid(), parseISO(), toISO(), format(), startOfMonth(), endOfMonth(), startOfDay(), endOfDay(), startOfYear(), endOfYear(), addDays(), addMonths(), getNextMonth(), getPreviousMonth(), isAfter(), isBefore(), isSameDay(), isWithinRange(), getYear(), getMonth(), getDate(), getDiff(), getWeekArray(), getWeekdays(), setYear(), setMonth()

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions