-
Notifications
You must be signed in to change notification settings - Fork 92
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 fixes #137
Comments
|
|
@caugner this should go into https://github.com/mengxiong10/vue2-datepicker 😉 |
Thanks @skjnldsv, I just did that: mengxiong10/vue2-datepicker#290 |
@skjnldsv The author of vue2-datepicker has suggested the following solution (requires v2.11.0 or later) to support changing month and year individually: <template>
<div id="app">
<date-picker
@select-year="handleSelectYear"
@select-month="handleSelectMonth"
v-model="value"
lang="en"
ref="datepicker"
confirm
></date-picker>
</div>
</template>
<script>
import DatePicker from "vue2-datepicker";
export default {
name: "App",
components: { DatePicker },
data() {
return {
value: null
};
},
methods: {
handleSelectYear(year) {
if (this.value) {
const value = new Date(new Date(this.value).setFullYear(year));
this.$refs.datepicker.selectDate(value);
}
},
handleSelectMonth(month) {
if (this.value) {
const value = new Date(new Date(this.value).setMonth(month));
this.$refs.datepicker.selectDate(value);
}
}
}
};
</script> |
@caugner can you implement the changes on contacts then? :) |
@skjnldsv Sure, will submit a PR these days. Any reason not to implement it in |
@caugner Good question, I assumed it was just a matter or binding the year/month event to update contact which was, well, a contact issue. |
@caugner any update? :) |
The text was updated successfully, but these errors were encountered: