|
|
@@ -100,8 +100,16 @@
|
|
|
methods: {
|
|
|
//设置日期
|
|
|
setDate(date){
|
|
|
+ //苹果需要换成/
|
|
|
+ date=this.toChangeSplit(date)
|
|
|
+
|
|
|
this.getCanlendar(new Date(date))
|
|
|
},
|
|
|
+ //苹果需要换成/
|
|
|
+ toChangeSplit(date){
|
|
|
+ console.log('------------',date)
|
|
|
+ return date.replace(/\-/g, '/');
|
|
|
+ },
|
|
|
chooseDate(item) {
|
|
|
this.$emit('click',item)
|
|
|
let strList = []; //滑动数
|
|
|
@@ -122,7 +130,9 @@
|
|
|
|
|
|
this.changeCurrent(current)
|
|
|
},
|
|
|
+ //转换毫秒
|
|
|
getDateTime(date = '') {
|
|
|
+ date=this.toChangeSplit(date)
|
|
|
return new Date(date).getTime();
|
|
|
},
|
|
|
|
|
|
@@ -131,11 +141,11 @@
|
|
|
let str = '0,1,2,0'; //滑动数
|
|
|
if (str.indexOf(this.current + ',' + current) > -1) {
|
|
|
console.log('左滑了')
|
|
|
- this.getCanlendar(new Date(new Date(this.dateList[this.dateList.length - 1].date).getTime() + 24 * 60 *
|
|
|
+ this.getCanlendar(new Date(this.getDateTime(this.dateList[this.dateList.length - 1].date) + 24 * 60 *
|
|
|
60 * 1000))
|
|
|
} else if (str.split(',').reverse().join(",").indexOf(this.current + ',' + current) > -1) {
|
|
|
console.log('右滑了')
|
|
|
- this.getCanlendar(new Date(new Date(this.dateList[0].date).getTime() - 24 * 60 * 60 * 1000))
|
|
|
+ this.getCanlendar(new Date(this.getDateTime(this.dateList[0].date) - 24 * 60 * 60 * 1000))
|
|
|
}
|
|
|
this.current = current;
|
|
|
},
|
|
|
@@ -171,18 +181,18 @@
|
|
|
beginDateTime = 0,
|
|
|
beginDateXX = 1;
|
|
|
for (let i = 1; i <= nowMonthDay; i++) {
|
|
|
- let dayxx = new Date(d.yy + '-' + d.mm + '-' + i).getDay() == 0 ? 7 : new Date(d.yy + '-' + d.mm +
|
|
|
- '-' + i)
|
|
|
+ let dayxx = new Date(d.yy + '/' + d.mm + '/' + i).getDay() == 0 ? 7 : new Date(d.yy + '/' + d.mm +
|
|
|
+ '/' + i)
|
|
|
.getDay();
|
|
|
if (i == 1) {
|
|
|
beginDateXX = dayxx;
|
|
|
- beginDateTime = new Date(d.yy + '-' + d.mm + '-' + i).getTime();
|
|
|
+ beginDateTime = new Date(d.yy + '/' + d.mm + '/' + i).getTime();
|
|
|
}
|
|
|
if (nowMonthDay == i) {
|
|
|
lastDateXX = dayxx;
|
|
|
- lastDateTime = new Date(d.yy + '-' + d.mm + '-' + i).getTime();
|
|
|
+ lastDateTime = new Date(d.yy + '/' + d.mm + '/' + i).getTime();
|
|
|
}
|
|
|
- dateList.push(this.getDateInfo(d.yy + '-' + d.mm + '-' + i))
|
|
|
+ dateList.push(this.getDateInfo(d.yy + '/' + d.mm + '/' + i))
|
|
|
}
|
|
|
|
|
|
//最后一天不是星期日要补
|