Closed VictorPulzz closed 2 years ago
You can use a computed value to transform timezone.
<date-picker v-model="date" />
data() {
return { value: new Date() }
},
computed: {
date: {
get() {
if (this.value) {
return new Date(this.value.getTime() + this.timezoneOffset * 60 * 1000)
}
return this.value
},
set(val) {
if (val) {
this.value = new Date(this.value.getTime() - this.timezoneOffset * 60 * 1000)
}
this.value = val
}
}
}
Hmmm, how this work in disabled-date
?
use disabled-date
as usual.
disabledDate(date) {
return date < new Date()
}
Vue2-datepicker version:3.4.1 Vue version: 2.6.12 Browser: Chrome
Hello! Thanks for you cool plugin. But I faced with problem. In my service, the user can select his timezone, which will differ from the local one. And I would like the selected date or for example in the parameter: disabled-date. The time zone was taken into account. Could you add property
:timezone="Europe / Berlin"
Thanks A lot!