vuetify
vuetify copied to clipboard
[Feature Request] Possible to extend default DateAdapter with functions
Problem to solve
The default DateAdapter
has a great set of functions. But if you need one or more extra functions you either need to create your own adapter or use a third-party library adapter. It would be fantastic if there was a way to use existing adapter-functions and extend it with your own.
Proposed solution
- Export
VuetifyDateAdapter
so that it's possible to extend that class with functions.
export class MyDateAdapter extends VuetifyDateAdapter {
....
myDateFunction() {
return new Date();
}
}
- Extend the date options object with a new functions-option that will work the same way as current
formats
-option. TheDateAdapter
interface would need to be exported so that typescript can work as expected
interface MyDateAdapter extends DateAdapter<Date> {
myDateFunction(): Date;
}