You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening the dropdown, expecting currentMonth to be set to 8 (august).
Actual behavior
currentMonth is set to current date's, which is 9 (september) ..as I type now.
I've checked the source code. It seems that currentMonth and currentYear is set when component is mounted. I see that there is a watch for the value. However, I suspect that the hook will not be called until data changes.
I could use computed to make use of reactive value
computed: {
dateValue: {
get() {
let ts = this.dateParser(val)
if (!isNaN(ts)) {
let date = new Date(ts)
if (date.getHours() !== 0) {
date = new Date(ts + date.getTimezoneOffset() * 60 * 1000)
}
return date;
}
return this.now;
}
set() {
if (this.limit && ((this.limit.from && date < this.limit.from) || (this.limit.to && date >= this.limit.to)))
{
this.$emit('input', oldVal || '')
} else {
this.currentMonth = this.date.getMonth()
this.currentYear = this.date.getFullYear()
}
}
}
}
The text was updated successfully, but these errors were encountered:
OS, browser, uiv version
Windows 10
Chrome 60
uiv 0.11.9
Which component
DatePicker
Steps to reproduce the problem
Expected behavior
When opening the dropdown, expecting currentMonth to be set to 8 (august).
Actual behavior
currentMonth
is set to current date's, which is 9 (september) ..as I type now.I've checked the source code. It seems that
currentMonth
andcurrentYear
is set when component ismounted
. I see that there is awatch
for thevalue
. However, I suspect that the hook will not be called until data changes.I could use
computed
to make use of reactive valueThe text was updated successfully, but these errors were encountered: