-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Datepicker initial view date when opened #94
Comments
No one prop can customize it. import DatePicker from 'vue2-datepicker'
DatePicker.components.CalendarPanel.methods.updateNow = function () {
this.now = this.value
? new Date(this.value)
: new Date('2017-01-01') // when the value is empty, default is new Date()
} |
Thanks, it works! For those who need it put this code in main.js and use view-date="2017-01-01" prop where you need it in the datepicker component.
|
v2.10.0 Add the prop
|
mengxiong10
added a commit
that referenced
this issue
Feb 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The date picker view is always opened at the present date or the model value date.
In my use case i have the last 18 years disabled and the user has to go 18 years behind so that he can select a date. A workaround is to initialize the date with the maximum valid date but if the input is empty it will open at the present date.
Could we have a prop that tells the component at what date the view should open?
The text was updated successfully, but these errors were encountered: