mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 21:00:36 +03:00
selectYear selectMonth function modify
This commit is contained in:
+4
-4
@@ -187,9 +187,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
init () {
|
init () {
|
||||||
if (this.type.toLowerCase() == 'month') {
|
if (this.type.toLowerCase() === 'month') {
|
||||||
this.panel = 'MONTH'
|
this.panel = 'MONTH'
|
||||||
} else if (this.type.toLowerCase() == 'year') {
|
} else if (this.type.toLowerCase() === 'year') {
|
||||||
this.panel = 'YEAR'
|
this.panel = 'YEAR'
|
||||||
} else {
|
} else {
|
||||||
this.panel = 'DATE'
|
this.panel = 'DATE'
|
||||||
@@ -256,7 +256,7 @@ export default {
|
|||||||
selectYear (year) {
|
selectYear (year) {
|
||||||
this.changeCalendarYear(year)
|
this.changeCalendarYear(year)
|
||||||
if (this.type.toLowerCase() === 'year') {
|
if (this.type.toLowerCase() === 'year') {
|
||||||
return this.selectDate(this.now)
|
return this.selectDate(new Date(this.now))
|
||||||
}
|
}
|
||||||
this.showPanelMonth()
|
this.showPanelMonth()
|
||||||
},
|
},
|
||||||
@@ -264,7 +264,7 @@ export default {
|
|||||||
this.changeCalendarMonth(month)
|
this.changeCalendarMonth(month)
|
||||||
|
|
||||||
if (this.type.toLowerCase() === 'month') {
|
if (this.type.toLowerCase() === 'month') {
|
||||||
return this.selectDate(this.now)
|
return this.selectDate(new Date(this.now))
|
||||||
}
|
}
|
||||||
|
|
||||||
this.showPanelDate()
|
this.showPanelDate()
|
||||||
|
|||||||
Reference in New Issue
Block a user