当前时间的年月日yyyy-mm-dd

getDate(type) {
            const date = new Date();
            let year = date.getFullYear();
            let month = date.getMonth() + 1;
            let day = date.getDate();

          //  if (type === "start") {
                year = year - 100;
          //  } else if (type === "end") {
                // year = year + 2;
          //  }
            month = month > 9 ? month : "0" + month;
            day = day > 9 ? day : "0" + day;
            return `${year}-${month}-${day}`;
        },

你可能感兴趣的:(php,前端,服务器)