4343</template >
4444
4545<script >
46- import { idate } from ' ../../date' ;
46+ import idate from ' ../../date' ;
4747
4848import VuecMonth from ' ./month.vue' ;
4949import DefaultDayView from ' ./default-day.vue' ;
@@ -104,7 +104,7 @@ export default {
104104 },
105105 data () {
106106 return {
107- now : idate () ,
107+ Xdate : this . date ,
108108 dateUnderCursor: null ,
109109 };
110110 },
@@ -127,13 +127,13 @@ export default {
127127 months () {
128128 const months = [];
129129
130- let date = idate (this .date );
130+ let date = idate (this .Xdate );
131131
132132 if (this .showPreviousWeeks ) {
133133 date .startOf (' Month' );
134134 }
135135
136- const end = idate (this .date ).add (this .visibleMonths - 1 , ' Month' ).endOf (' Month' );
136+ const end = idate (this .Xdate ).add (this .visibleMonths - 1 , ' Month' ).endOf (' Month' );
137137
138138 while (date .isBefore (end)) {
139139 const monthKey = date .format (' YYYY/MM' );
@@ -147,6 +147,7 @@ export default {
147147 date = date .add (1 , ' Month' ).startOf (' Month' );
148148 }
149149
150+ months .length = this .visibleMonths ;
150151 return months;
151152 },
152153 },
@@ -168,12 +169,12 @@ export default {
168169 this .$emit (' selectionChange' , { date, selected });
169170 },
170171 previousPage () {
171- this .date = this .date .subtract (this .visibleMonths , ' Month' ).startOf (' Month' );
172- this .$emit (' previous-page' , this .date );
172+ this .Xdate = this .Xdate .subtract (this .visibleMonths , ' Month' ).startOf (' Month' );
173+ this .$emit (' previous-page' , this .Xdate );
173174 },
174175 nextPage () {
175- this .date = this .date .add (this .visibleMonths , ' Month' ).startOf (' Month' );
176- this .$emit (' next-page' , this .date );
176+ this .Xdate = this .Xdate .add (this .visibleMonths , ' Month' ).startOf (' Month' );
177+ this .$emit (' next-page' , this .Xdate );
177178 },
178179 },
179180};
0 commit comments