File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
docs/src/pages/en/features Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -338,3 +338,35 @@ export interface DateAdapter<TDate> {
338
338
getNextMonth (date : TDate ): TDate
339
339
}
340
340
```
341
+
342
+ ## Inheritance
343
+
344
+ You can also extend and override build-in DateAdapter using class inheritance:
345
+
346
+ ``` ts
347
+ import { VuetifyDateAdapter } from ' vuetify/date/adapters/vuetify'
348
+
349
+ export class MyAdapter extends VuetifyDateAdapter {
350
+ sayHello () {
351
+ return ` Hello, current week starts at ${this .startOfWeek (this .date ())} `
352
+ }
353
+ override startOfWeek (date : Date , firstDayOfWeek ? : string | number ): Date {
354
+ return super .startOfWeek (date , 2 ) // forcing Tuesday
355
+ }
356
+ }
357
+ ```
358
+
359
+ ``` ts { resource="src/plugins/vuetify.js" }
360
+ export default createVuetify ({
361
+ date: {
362
+ adapter: MyAdapter ,
363
+ },
364
+ ...
365
+ })
366
+
367
+ declare module ' vuetify' {
368
+ namespace DateModule {
369
+ interface Adapter extends MyAdapter {}
370
+ }
371
+ }
372
+ ```
Original file line number Diff line number Diff line change 76
76
"./labs/components" : " ./lib/labs/components.js" ,
77
77
"./labs/*" : " ./lib/labs/*/index.js" ,
78
78
"./util/colors" : " ./lib/util/colors.js" ,
79
+ "./date/adapters/*" : " ./lib/composables/date/adapters/*.js" ,
79
80
"./util/transitions" : " ./lib/components/transitions/createTransition.js" ,
80
81
"./dist/vuetify.js" : {
81
82
"types" : " ./dist/vuetify.d.ts" ,
Original file line number Diff line number Diff line change 1
1
export { createDate , useDate , DateAdapterSymbol } from './date'
2
2
export type { DateAdapter } from './DateAdapter'
3
3
export type { DateOptions , DateInstance , DateModule } from './date'
4
+ export { VuetifyDateAdapter } from './adapters/vuetify'
You can’t perform that action at this time.
0 commit comments