Setting the Month and Year in a Form Field with JavaScript
This code sets the value of the element with the ID "statisticsMonth" to the current date in the format "YYYY-MM". The getFormatDate() function is assumed to return the current date in the format "YYYY-MM-DD", and the .slice(0, -3) method is used to remove the day portion of the date, leaving only the year and month.
原文地址: https://www.cveoy.top/t/topic/qe4E 著作权归作者所有。请勿转载和采集!