Commit c2c76fe7 authored by sujie@126.com's avatar sujie@126.com

dd

parent f678d536
......@@ -71,7 +71,7 @@ Component({
} else if (type === 'next_month') {
newMonth = curMonth + 1;
if (newMonth > 12) {
newYear = curYear + 1;
newYear = Number(curYear) + 1;
newMonth = 1;
}
}
......
......@@ -53,6 +53,7 @@ Component({
methods: {
chooseDate(e) {
const { type } = e.currentTarget.dataset;
if (!type) return;
const methodName = this.data.handleMap[type];
this[methodName](type);
......@@ -77,13 +78,13 @@ Component({
if (type === 'prev_month') {
newMonth = curMonth - 1;
if (newMonth < 1) {
newYear = curYear - 1;
newYear = Number(curYear) - 1;
newMonth = 12;
}
} else if (type === 'next_month') {
newMonth = curMonth + 1;
if (newMonth > 12) {
newYear = curYear + 1;
newYear = Number(curYear) + 1;
newMonth = 1;
}
}
......
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