Commit abedbb33 by yanju

fix-issue#3

parent 6c7c89e8
......@@ -6,7 +6,7 @@
const format = (date) => {
const dateObj = new Date(date);
const year = dateObj.getFullYear();
const month = dateObj.getMonth() > 10 ? `${dateObj.getMonth() + 1}` : `0${dateObj.getMonth() + 1}`;
const month = dateObj.getMonth() > 8 ? `${dateObj.getMonth() + 1}` : `0${dateObj.getMonth() + 1}`;
const day = dateObj.getDate() > 9 ? `${dateObj.getDate()}` : `0${dateObj.getDate()}`;
return `${year}-${month}-${day}`
};
......
......@@ -92,13 +92,13 @@
// 改变月份
changeMonth(count) {
const changedDate = new Date(this.year, this.month + count - 1);
console.log(changedDate);
this.datePicker.changeDate(changedDate);
},
// 选择日期
selectDate(selectedDate) {
let selectedDate2 = selectedDate;
this.selectedDate = selectedDate.value;
console.log( selectedDate)
this.$refs.input.blur();
this.$emit(config.event.listenDateChange,selectedDate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment