|
@@ -147,20 +147,20 @@
|
|
|
const editStatus = {
|
|
|
startMonth: false,
|
|
|
};
|
|
|
- // function disabledDate(time) {
|
|
|
- // const currentMonth = new Date().getMonth();
|
|
|
- // const selectedMonth = time.getMonth();
|
|
|
- // const currentYear = new Date().getFullYear();
|
|
|
- // const selectedYear = time.getFullYear();
|
|
|
-
|
|
|
- // // 禁用当前年份之后的所有月份
|
|
|
- // if (selectedYear > currentYear) {
|
|
|
- // return true;
|
|
|
- // }
|
|
|
-
|
|
|
- // // 如果选择的是当前年份,只能选择当前月份之前的月份
|
|
|
- // return selectedYear === currentYear && selectedMonth >= currentMonth;
|
|
|
- // }
|
|
|
+ function disabledDate(time) {
|
|
|
+ const currentMonth = new Date().getMonth();
|
|
|
+ const selectedMonth = time.getMonth();
|
|
|
+ const currentYear = new Date().getFullYear();
|
|
|
+ const selectedYear = time.getFullYear();
|
|
|
+
|
|
|
+ // 禁用当前年份之后的所有月份
|
|
|
+ if (selectedYear > currentYear) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果选择的是当前年份,只能选择当前月份之前的月份
|
|
|
+ return selectedYear === currentYear && selectedMonth >= currentMonth;
|
|
|
+ }
|
|
|
|
|
|
function checkCurrentMonthHandle() {
|
|
|
checkCurrent().then((res) => {
|