refactor(date): delegate to v0 createDate as runtime#22768
Open
johnleider wants to merge 12 commits intonextfrom
Open
refactor(date): delegate to v0 createDate as runtime#22768johnleider wants to merge 12 commits intonextfrom
johnleider wants to merge 12 commits intonextfrom
Conversation
Bridge wraps v0 DateAdapter and translates 4 method signatures where Vuetify passes firstDayOfWeek as a parameter but v0 uses a property: startOfWeek, getWeekArray, getWeekdays, getWeek. Preserves calculateWeekWithFirstDayOfYear locally for the getWeek firstDayOfYear code path which v0 does not support natively.
Wraps Vuetify-style custom adapters (param-based firstDayOfWeek signatures) to satisfy v0's DateAdapter interface. This is the reverse of VuetifyDateBridge — together they form the wrapper chain: Old custom adapter → LegacyDateAdapterCompat → VuetifyDateBridge → Components Translated methods forward the firstDayOfWeek property as a parameter. v0-only methods use optional chaining with unsupported() fallback.
Replace two-symbol injection (DateOptionsSymbol + DateAdapterSymbol) with single DateSymbol backed by v0's createDate runtime. Detection logic classifies adapters as v0-native, legacy class, or legacy instance and wraps appropriately via LegacyDateAdapterCompat. Default adapter is Vuetify0DateAdapter when none provided. Locale sync watches Vuetify's locale.current and pushes resolved locale strings to v0's adapter. Full ~35 entry locale map preserved and merged with user overrides. BREAKING CHANGE: DateOptionsSymbol and DateAdapterSymbol are deprecated. Use DateSymbol and useDate() instead.
…apter Replaces the old VuetifyDateAdapter (Date-based) delegation with Vuetify0DateAdapter (Temporal-based). Implements the full v0 DateAdapter<string> interface with toBase/fromBase boundary conversion pattern.
- Delete old DateAdapter.ts and adapters/vuetify.ts - Move DateAdapter interface into bridge.ts (only consumer) - Update index.ts exports: DateSymbol, VuetifyDateBridge, LegacyDateAdapterCompat, StringDateAdapter - Update framework.ts: use date.install(app) and DateSymbol instead of manual provides - Update date.ts import: DateAdapter from ./bridge instead of deleted ./DateAdapter
- Bridge: validate firstDayOfWeek, clamp fractional/out-of-range values - Calendar: normalize isoDate to date-only format (split at T) - VDatePicker browser tests: use PlainDateTime properties (.day, .year, .month) - VDatePicker date tests: update range assertions for PlainDateTime model values
Reverts workarounds from v0.1.12 now that v0 derives firstDayOfWeek
and minimalDays from locale. Requires @vuetify/v0 >= 0.1.13.
Also removes toISO().split('T')[0] workaround in calendar.ts since
v0 now returns date-only strings from toISO().
J-Sek
reviewed
Apr 2, 2026
| this.base.getNextMonth(this.base.date(date)!) | ||
| ) | ||
| startOfWeek (date: string, firstDayOfWeek?: number): string { | ||
| return this.fromBase(this.base.startOfWeek(this.toBase(date), firstDayOfWeek)) |
Contributor
There was a problem hiding this comment.
if v0 is not meant to accept firstDayOfWeek, the workaround would be:
withWeekInfoOverride<T> (action: () => T, firstDayOfWeek?: number): T {
const old = this.base.firstDayOfWeek
this.base.firstDayOfWeek = firstDayOfWeek ?? this.base.firstDayOfWeek
const result = action()
this.base.firstDayOfWeek = old
return result
}
startOfWeek (date: string, firstDayOfWeek?: number): string {
const action = () => this.fromBase(this.base.startOfWeek(this.toBase(date)))
return firstDayOfWeek
? this.withWeekInfoOverride(action, firstDayOfWeek)
: action()
}
endOfWeek (date: string, firstDayOfWeek?: number): string {
const action = () => this.fromBase(this.base.endOfWeek(this.toBase(date)))
return this.withWeekInfoOverride(action, firstDayOfWeek) // shorter if it matters
}
// repeat for:
// - getWeek
// - getWeekdays
// - getWeekArray
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@vuetify/v0'screateDate()as the runtimeVuetifyDateAdapter(native Date) with v0'sVuetify0DateAdapter(Temporal)VuetifyDateBridge<T>to translate Vuetify'sstring|numberparam types to v0'snumberLegacyDateAdapterCompat<T>for backwards compat with old custom adaptersStringDateAdapterover v0's Temporal adapterDateOptionsSymbol+DateAdapterSymbol) into singleDateSymbolframework.tsto usedate.install(app)patternCloses vuetifyjs/0#111
Breaking Changes
DatetoTemporal.PlainDateTimeDateAdapter<T>interface (compat shim provided with deprecation warning)DateAdapterSymboldeprecated — useuseDate()instead@vuetify/v0(once shipped)