|
@@ -17,7 +17,7 @@ |
|
@@ -17,7 +17,7 @@ |
17
|
</thead>
|
17
|
</thead>
|
18
|
<tbody>
|
18
|
<tbody>
|
19
|
<tr v-for="week in calendar">
|
19
|
<tr v-for="week in calendar">
|
20
|
- <td :class="{today: day.date.toDateString() === new Date().toDateString(), selected: day.day === this.currentDay, not: ! day.day || day.day === 32}" v-for="day in week" track-by="$index" v-text="day.day === 32 ? '' : day.day" @click="selectDate(day)"></td>
|
20
|
+ <td :class="{today: day.date.toDateString() === new Date().toDateString(), selected: day.day === this.currentDay, old: isnot(day,$index)}" v-for="day in week" track-by="$index" v-text="day.day === 32 ? '' : day.day" @click="selectDate(day,$index)"></td>
|
21
|
</tr>
|
21
|
</tr>
|
22
|
</tbody>
|
22
|
</tbody>
|
23
|
</table>
|
23
|
</table>
|
|
@@ -25,7 +25,7 @@ |
|
@@ -25,7 +25,7 @@ |
25
|
</template>
|
25
|
</template>
|
26
|
<script>
|
26
|
<script>
|
27
|
export default {
|
27
|
export default {
|
28
|
- props:["dateTime","mo"],
|
28
|
+ props:["dateTime","mo","state"],
|
29
|
data(){
|
29
|
data(){
|
30
|
return {
|
30
|
return {
|
31
|
// date: new Date(this.dateText),
|
31
|
// date: new Date(this.dateText),
|
|
@@ -35,6 +35,7 @@ |
|
@@ -35,6 +35,7 @@ |
35
|
}
|
35
|
}
|
36
|
},
|
36
|
},
|
37
|
computed: {
|
37
|
computed: {
|
|
|
38
|
+
|
38
|
month() {
|
39
|
month() {
|
39
|
return this.months[this.dateTime.month]
|
40
|
return this.months[this.dateTime.month]
|
40
|
},
|
41
|
},
|
|
@@ -95,8 +96,8 @@ |
|
@@ -95,8 +96,8 @@ |
95
|
this.currentDay = ""
|
96
|
this.currentDay = ""
|
96
|
this.dateTime.month+=1
|
97
|
this.dateTime.month+=1
|
97
|
},
|
98
|
},
|
98
|
- selectDate(value) {
|
|
|
99
|
- if (! value.day || value.day === 32) {
|
99
|
+ selectDate(value,index) {
|
|
|
100
|
+ if(this.isnot(value,index)){
|
100
|
return
|
101
|
return
|
101
|
}
|
102
|
}
|
102
|
this.dateTime.date=value.day
|
103
|
this.dateTime.date=value.day
|
|
@@ -104,6 +105,13 @@ |
|
@@ -104,6 +105,13 @@ |
104
|
},
|
105
|
},
|
105
|
tomonth(){
|
106
|
tomonth(){
|
106
|
this.mo="month"
|
107
|
this.mo="month"
|
|
|
108
|
+ },
|
|
|
109
|
+ isnot(day,index){
|
|
|
110
|
+ console.log(this.state);
|
|
|
111
|
+ if(this.state=="week"){
|
|
|
112
|
+ return ! day.day || day.day === 32||index!==0;
|
|
|
113
|
+ }
|
|
|
114
|
+ return ! day.day || day.day === 32;
|
107
|
}
|
115
|
}
|
108
|
},
|
116
|
},
|
109
|
ready() {
|
117
|
ready() {
|