Skip to content

Commit 5a846aa

Browse files
fix next year
1 parent a99d557 commit 5a846aa

File tree

6 files changed

+39
-22
lines changed

6 files changed

+39
-22
lines changed

dist/vue-rangedate-picker.common.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,11 +508,11 @@ var __vue_module__ = {
508508
type: Object,
509509
default: function () { return null; }
510510
},
511-
startActiveMonth: {
511+
startMonth: {
512512
type: Number,
513513
default: new Date().getMonth()
514514
},
515-
startActiveYear: {
515+
startYear: {
516516
type: Number,
517517
default: new Date().getFullYear()
518518
},
@@ -537,7 +537,8 @@ var __vue_module__ = {
537537
isOpen: false,
538538
presetActive: '',
539539
showMonth: false,
540-
activeMonthStart: this.startActiveMonth
540+
activeMonthStart: this.startMonth,
541+
startActiveYear: this.startYear
541542
}
542543
},
543544
created: function created () {
@@ -569,7 +570,10 @@ var __vue_module__ = {
569570
return new Date(this.startActiveYear, this.activeMonthStart + 2, 0).getDate()
570571
},
571572
startNextActiveMonth: function () {
572-
return this.activeMonthStart >= 11 ? 0 : this.activeMonthStart + 1
573+
return this.activeMonthStart + 1
574+
},
575+
nextActiveYear: function () {
576+
return new Date(this.startActiveYear, this.activeMonthStart + 1, 1).getFullYear()
573577
},
574578
finalPresetRanges: function () {
575579
var tmp = {};
@@ -708,7 +712,7 @@ var __vue_module__ = {
708712
};
709713

710714
var __$__vue_module__ = Object.assign(__vue_module__, {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"calendar-root"},[_c('div',{staticClass:"input-date",on:{"click":function($event){_vm.toggleCalendar();}}},[_vm._v(" "+_vm._s(_vm.getDateString(_vm.dateRange.start))+" - "+_vm._s(_vm.getDateString(_vm.dateRange.end)))]),_vm._v(" "),(_vm.isOpen)?_c('div',{staticClass:"calendar",class:{'calendar-mobile ': _vm.isCompact, 'calendar-right-to-left': _vm.isRighttoLeft}},[(!_vm.isCompact)?_c('div',{staticClass:"calendar-head"},[_c('h2',[_vm._v(_vm._s(_vm.captions.title))]),_vm._v(" "),_c('i',{staticClass:"close",on:{"click":function($event){_vm.toggleCalendar();}}})]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"calendar-wrap"},[(_vm.showMonth)?_c('div',{staticClass:"calendar_month_left",class:{'calendar-left-mobile': _vm.isCompact}},[_c('div',{staticClass:"months-text"},[_c('i',{staticClass:"left",on:{"click":_vm.goPrevMonth}}),_vm._v(" "),(_vm.isCompact)?_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}}):_vm._e(),_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.activeMonthStart] +' '+ _vm.startActiveYear))]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startMonthDay, _vm.endMonthDate))},on:{"click":function($event){_vm.selectFirstItem(r, i);}}})
711-
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth] +' '+ _vm.startActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
715+
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth % 12] +' '+ _vm.nextActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
712716
var obj;}))})],2):_vm._e()]),_vm._v(" "),(!_vm.showMonth || !_vm.isCompact)?_c('div',{staticClass:"calendar-range",class:{'calendar-range-mobile ': _vm.isCompact}},[_c('ul',{staticClass:"calendar_preset"},[_vm._l((_vm.finalPresetRanges),function(item,idx){return _c('li',{key:idx,staticClass:"calendar_preset-ranges",class:{'active-preset': _vm.presetActive === item.label},on:{"click":function($event){_vm.updatePreset(item);}}},[_vm._v(" "+_vm._s(item.label)+" ")])}),_vm._v(" "),_c('li',[_c('button',{staticClass:"calendar-btn-apply",on:{"click":function($event){_vm.setDateValue();}}},[_vm._v(_vm._s(_vm.captions.ok_button))])])],2)]):_vm._e()]):_vm._e()])},staticRenderFns: [],_scopeId: 'data-v-5e837f70',});
713717
__$__vue_module__.prototype = __vue_module__.prototype;
714718

dist/vue-rangedate-picker.esm.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ var __vue_module__ = {
504504
type: Object,
505505
default: function () { return null; }
506506
},
507-
startActiveMonth: {
507+
startMonth: {
508508
type: Number,
509509
default: new Date().getMonth()
510510
},
511-
startActiveYear: {
511+
startYear: {
512512
type: Number,
513513
default: new Date().getFullYear()
514514
},
@@ -533,7 +533,8 @@ var __vue_module__ = {
533533
isOpen: false,
534534
presetActive: '',
535535
showMonth: false,
536-
activeMonthStart: this.startActiveMonth
536+
activeMonthStart: this.startMonth,
537+
startActiveYear: this.startYear
537538
}
538539
},
539540
created: function created () {
@@ -565,7 +566,10 @@ var __vue_module__ = {
565566
return new Date(this.startActiveYear, this.activeMonthStart + 2, 0).getDate()
566567
},
567568
startNextActiveMonth: function () {
568-
return this.activeMonthStart >= 11 ? 0 : this.activeMonthStart + 1
569+
return this.activeMonthStart + 1
570+
},
571+
nextActiveYear: function () {
572+
return new Date(this.startActiveYear, this.activeMonthStart + 1, 1).getFullYear()
569573
},
570574
finalPresetRanges: function () {
571575
var tmp = {};
@@ -704,7 +708,7 @@ var __vue_module__ = {
704708
};
705709

706710
var __$__vue_module__ = Object.assign(__vue_module__, {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"calendar-root"},[_c('div',{staticClass:"input-date",on:{"click":function($event){_vm.toggleCalendar();}}},[_vm._v(" "+_vm._s(_vm.getDateString(_vm.dateRange.start))+" - "+_vm._s(_vm.getDateString(_vm.dateRange.end)))]),_vm._v(" "),(_vm.isOpen)?_c('div',{staticClass:"calendar",class:{'calendar-mobile ': _vm.isCompact, 'calendar-right-to-left': _vm.isRighttoLeft}},[(!_vm.isCompact)?_c('div',{staticClass:"calendar-head"},[_c('h2',[_vm._v(_vm._s(_vm.captions.title))]),_vm._v(" "),_c('i',{staticClass:"close",on:{"click":function($event){_vm.toggleCalendar();}}})]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"calendar-wrap"},[(_vm.showMonth)?_c('div',{staticClass:"calendar_month_left",class:{'calendar-left-mobile': _vm.isCompact}},[_c('div',{staticClass:"months-text"},[_c('i',{staticClass:"left",on:{"click":_vm.goPrevMonth}}),_vm._v(" "),(_vm.isCompact)?_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}}):_vm._e(),_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.activeMonthStart] +' '+ _vm.startActiveYear))]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startMonthDay, _vm.endMonthDate))},on:{"click":function($event){_vm.selectFirstItem(r, i);}}})
707-
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth] +' '+ _vm.startActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
711+
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth % 12] +' '+ _vm.nextActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
708712
var obj;}))})],2):_vm._e()]),_vm._v(" "),(!_vm.showMonth || !_vm.isCompact)?_c('div',{staticClass:"calendar-range",class:{'calendar-range-mobile ': _vm.isCompact}},[_c('ul',{staticClass:"calendar_preset"},[_vm._l((_vm.finalPresetRanges),function(item,idx){return _c('li',{key:idx,staticClass:"calendar_preset-ranges",class:{'active-preset': _vm.presetActive === item.label},on:{"click":function($event){_vm.updatePreset(item);}}},[_vm._v(" "+_vm._s(item.label)+" ")])}),_vm._v(" "),_c('li',[_c('button',{staticClass:"calendar-btn-apply",on:{"click":function($event){_vm.setDateValue();}}},[_vm._v(_vm._s(_vm.captions.ok_button))])])],2)]):_vm._e()]):_vm._e()])},staticRenderFns: [],_scopeId: 'data-v-5e837f70',});
709713
__$__vue_module__.prototype = __vue_module__.prototype;
710714

dist/vue-rangedate-picker.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,11 @@ var __vue_module__ = {
510510
type: Object,
511511
default: function () { return null; }
512512
},
513-
startActiveMonth: {
513+
startMonth: {
514514
type: Number,
515515
default: new Date().getMonth()
516516
},
517-
startActiveYear: {
517+
startYear: {
518518
type: Number,
519519
default: new Date().getFullYear()
520520
},
@@ -539,7 +539,8 @@ var __vue_module__ = {
539539
isOpen: false,
540540
presetActive: '',
541541
showMonth: false,
542-
activeMonthStart: this.startActiveMonth
542+
activeMonthStart: this.startMonth,
543+
startActiveYear: this.startYear
543544
}
544545
},
545546
created: function created () {
@@ -571,7 +572,10 @@ var __vue_module__ = {
571572
return new Date(this.startActiveYear, this.activeMonthStart + 2, 0).getDate()
572573
},
573574
startNextActiveMonth: function () {
574-
return this.activeMonthStart >= 11 ? 0 : this.activeMonthStart + 1
575+
return this.activeMonthStart + 1
576+
},
577+
nextActiveYear: function () {
578+
return new Date(this.startActiveYear, this.activeMonthStart + 1, 1).getFullYear()
575579
},
576580
finalPresetRanges: function () {
577581
var tmp = {};
@@ -710,7 +714,7 @@ var __vue_module__ = {
710714
};
711715

712716
var __$__vue_module__ = Object.assign(__vue_module__, {render: function(){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"calendar-root"},[_c('div',{staticClass:"input-date",on:{"click":function($event){_vm.toggleCalendar();}}},[_vm._v(" "+_vm._s(_vm.getDateString(_vm.dateRange.start))+" - "+_vm._s(_vm.getDateString(_vm.dateRange.end)))]),_vm._v(" "),(_vm.isOpen)?_c('div',{staticClass:"calendar",class:{'calendar-mobile ': _vm.isCompact, 'calendar-right-to-left': _vm.isRighttoLeft}},[(!_vm.isCompact)?_c('div',{staticClass:"calendar-head"},[_c('h2',[_vm._v(_vm._s(_vm.captions.title))]),_vm._v(" "),_c('i',{staticClass:"close",on:{"click":function($event){_vm.toggleCalendar();}}})]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"calendar-wrap"},[(_vm.showMonth)?_c('div',{staticClass:"calendar_month_left",class:{'calendar-left-mobile': _vm.isCompact}},[_c('div',{staticClass:"months-text"},[_c('i',{staticClass:"left",on:{"click":_vm.goPrevMonth}}),_vm._v(" "),(_vm.isCompact)?_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}}):_vm._e(),_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.activeMonthStart] +' '+ _vm.startActiveYear))]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'first', _vm.startMonthDay, _vm.endMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startMonthDay, _vm.endMonthDate))},on:{"click":function($event){_vm.selectFirstItem(r, i);}}})
713-
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth] +' '+ _vm.startActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
717+
var obj;}))})],2):_vm._e(),_vm._v(" "),(!_vm.isCompact)?_c('div',{staticClass:"calendar_month_right"},[_c('div',{staticClass:"months-text"},[_vm._v(" "+_vm._s(_vm.monthsLocale[_vm.startNextActiveMonth % 12] +' '+ _vm.nextActiveYear)+" "),_c('i',{staticClass:"right",on:{"click":_vm.goNextMonth}})]),_vm._v(" "),_c('ul',{class:_vm.s.daysWeeks},_vm._l((_vm.shortDaysLocale),function(item){return _c('li',[_vm._v(_vm._s(item))])})),_vm._v(" "),_vm._l((6),function(r){return _c('ul',{class:[_vm.s.days]},_vm._l((_vm.numOfDays),function(i){return _c('li',{class:[( obj = {}, obj[_vm.s.daysSelected] = _vm.isDateSelected(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj[_vm.s.daysInRange] = _vm.isDateInRange(r, i, 'second', _vm.startNextMonthDay, _vm.endNextMonthDate), obj )],domProps:{"innerHTML":_vm._s(_vm.getDayCell(r, i, _vm.startNextMonthDay, _vm.endNextMonthDate))},on:{"click":function($event){_vm.selectSecondItem(r, i);}}})
714718
var obj;}))})],2):_vm._e()]),_vm._v(" "),(!_vm.showMonth || !_vm.isCompact)?_c('div',{staticClass:"calendar-range",class:{'calendar-range-mobile ': _vm.isCompact}},[_c('ul',{staticClass:"calendar_preset"},[_vm._l((_vm.finalPresetRanges),function(item,idx){return _c('li',{key:idx,staticClass:"calendar_preset-ranges",class:{'active-preset': _vm.presetActive === item.label},on:{"click":function($event){_vm.updatePreset(item);}}},[_vm._v(" "+_vm._s(item.label)+" ")])}),_vm._v(" "),_c('li',[_c('button',{staticClass:"calendar-btn-apply",on:{"click":function($event){_vm.setDateValue();}}},[_vm._v(_vm._s(_vm.captions.ok_button))])])],2)]):_vm._e()]):_vm._e()])},staticRenderFns: [],_scopeId: 'data-v-5e837f70',});
715719
__$__vue_module__.prototype = __vue_module__.prototype;
716720

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"test": "cross-env BABEL_ENV=test karma start test/karma.conf.js --single-run",
2626
"dev": "webpack-dashboard -- webpack-dev-server --config build/webpack.config.dev.js --open",
2727
"dev:coverage": "cross-env BABEL_ENV=test karma start test/karma.conf.js",
28-
"prepublish": "yon run build"
28+
"prepublish": "yon run build",
29+
"start": "npm run dev"
2930
},
3031
"lint-staged": {
3132
"*.{vue,jsx,js}": [

src/RangedatePicker.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<div class="calendar_month_right" v-if="!isCompact">
2525
<div class="months-text">
26-
{{monthsLocale[startNextActiveMonth] +' '+ startActiveYear}}
26+
{{monthsLocale[startNextActiveMonth % 12] +' '+ nextActiveYear}}
2727
<i class="right" @click="goNextMonth"></i>
2828
</div>
2929
<ul :class="s.daysWeeks">
@@ -49,7 +49,7 @@
4949
<li><button class="calendar-btn-apply" @click="setDateValue()">{{captions.ok_button}}</button></li>
5050
</ul>
5151
</div>
52-
52+
5353
</div>
5454
</div>
5555
</template>

src/js/rangedate-picker.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ export default {
151151
type: Object,
152152
default: () => null
153153
},
154-
startActiveMonth: {
154+
startMonth: {
155155
type: Number,
156156
default: new Date().getMonth()
157157
},
158-
startActiveYear: {
158+
startYear: {
159159
type: Number,
160160
default: new Date().getFullYear()
161161
},
@@ -180,7 +180,8 @@ export default {
180180
isOpen: false,
181181
presetActive: '',
182182
showMonth: false,
183-
activeMonthStart: this.startActiveMonth
183+
activeMonthStart: this.startMonth,
184+
startActiveYear: this.startYear
184185
}
185186
},
186187
created () {
@@ -212,7 +213,10 @@ export default {
212213
return new Date(this.startActiveYear, this.activeMonthStart + 2, 0).getDate()
213214
},
214215
startNextActiveMonth: function () {
215-
return this.activeMonthStart >= 11 ? 0 : this.activeMonthStart + 1
216+
return this.activeMonthStart + 1
217+
},
218+
nextActiveYear: function () {
219+
return new Date(this.startActiveYear, this.activeMonthStart + 1, 1).getFullYear()
216220
},
217221
finalPresetRanges: function () {
218222
const tmp = {}

0 commit comments

Comments
 (0)