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

[Bug Report][3.7.6] VDatePicker display-value prop doesn’t work #20863

Open
LeBenLeBen opened this issue Jan 14, 2025 · 3 comments · May be fixed by #20879
Open

[Bug Report][3.7.6] VDatePicker display-value prop doesn’t work #20863

LeBenLeBen opened this issue Jan 14, 2025 · 3 comments · May be fixed by #20879
Assignees
Labels
C: VDatePicker T: bug Functionality that does not work as intended/expected T: documentation

Comments

@LeBenLeBen
Copy link

Environment

Vuetify Version: 3.7.6
Vue Version: 3.5.13
Browsers: Firefox 134.0
OS: Mac OS 10.15

Steps to reproduce

Define a displayValue prop on a VDatePicker

Expected Behavior

Date picker should display the month/year matching the date provided to the displayValue prop

Actual Behavior

Date picker display the current month/year.

Reproduction Link

https://play.vuetifyjs.com/#...

@J-Sek
Copy link
Contributor

J-Sek commented Jan 17, 2025

You can use month and year props instead. For example:

<v-date-picker v-model="date" :month="9" :year="2023" />

displayValue is just a side-effect of VDatePicker calling makeVDatePickerMonthProps that calls makeCalendarProps and would actually be redundant if anyone would try to implement it.

@J-Sek J-Sek self-assigned this Jan 17, 2025
@J-Sek J-Sek added T: bug Functionality that does not work as intended/expected T: documentation C: VDatePicker labels Jan 17, 2025
@J-Sek J-Sek linked a pull request Jan 17, 2025 that will close this issue
@withboldt
Copy link

Using month and year props works but the behavior is not yet quite what we had before: VDatePicker effectively displays the passed in month and year but once the model-value changes, I expect the VDatePicker to display the model-value date instead of the values passed to month and year.

Also, there's currently (to my understanding) no prop for setting the day as month and year.

@J-Sek
Copy link
Contributor

J-Sek commented Feb 3, 2025

I can see the value of having control over year and month when we show up the picker, but I don't really see much of a benefit of having full external control over a component that exists to get input from the user and disappear once it's done.

This demo shows that in order to re-apply month and year you'd have to reset the picker. All you really lose is transition animation (can be kinda supplemented with <v-*-transition> wrapper, but won't be exactly the same).

Introducing day would bring nothing to the table except possibility for bugs and forcing us to make rounding decisions (e.g. is 31th of February just 28th (or 29th) or should it become 2nd (or 3rd) of March). If you can explain how it would work and give usage examples, that would be a material for separate feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDatePicker T: bug Functionality that does not work as intended/expected T: documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants