Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] DateAdapter: support formatByString function #18710

Closed
Assignees
Labels
E: date T: enhancement Functionality that enhances existing features typescript

Comments

@mtdvlpr
Copy link
Contributor

mtdvlpr commented Nov 17, 2023

Problem to solve

I want to use the date adapter to format a date with a custom string format. Currently you have to use the format function with predefined options.

Proposed solution

Implement the @date-io formatByString function:
formatByString(value: TDate, formatString: string): string;

@KaelWD
Copy link
Member

KaelWD commented Nov 17, 2023

This is not supported by Intl.DateTimeFormat, use a more complete library like date-fns for custom formatting.

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
@mtdvlpr
Copy link
Contributor Author

mtdvlpr commented Nov 17, 2023

@KaelWD, I am using the @date-io/date-fns adapter in the Vuetify config, so I expect the function that it supports, to be supported in the useDate function. Now that I try it in Vuetify Playground, it does work, but TypeScript says the function doesn't exist. So I guess this is more of a Bug Report...

Should I make a separate issue for this?

@KaelWD
Copy link
Member

KaelWD commented Nov 17, 2023

Hmm yeah we probably need some way to configure the types if you're using a full adapter.

@KaelWD KaelWD reopened this Nov 17, 2023
@KaelWD KaelWD added T: enhancement Functionality that enhances existing features E: date labels Nov 21, 2023
@KaelWD KaelWD self-assigned this Nov 21, 2023
@KaelWD KaelWD added this to the v3.5.0 (Polaris) milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment