Skip to content

Commit ae6ba5a

Browse files
committed
refactor(datepicker): Simplify selectDate method
1 parent fe7b189 commit ae6ba5a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/components/Datepicker.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,9 @@ export default {
651651
* @param {Number} timestamp
652652
*/
653653
selectDate(timestamp) {
654-
if (!timestamp) {
655-
this.selectedDate = null
656-
return
657-
}
658-
659654
const date = new Date(timestamp)
660-
this.selectedDate = date
661-
this.setPageDate(date)
655+
656+
this.setValue(date)
662657
this.$emit('selected', date)
663658
this.$emit('input', date)
664659
},

0 commit comments

Comments
 (0)