You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
395 B
JavaScript

// 下一月
const getNextMonth = function(v) {
let date = new Date(v);
let CurrentDate = "";
let year = date.getFullYear();
let month = (date.getMonth() + 1 + 1) < 10 ? "0" + (date.getMonth() + 1 + 1) : (date.getMonth() + 1 + 1);
if (month > 12) {
CurrentDate = (year + 1) + "-" + "01"
} else {
CurrentDate = year + "-" + month
}
return CurrentDate
}
export default getNextMonth