我需要一个JS函数来得到这个月的最后一个日期。举个例子,我需要这个月的最后一个星期三。
我将以年月日为论据。
getLastDayOfMonth('2022', '02', 'Wednesday');
function getLastDayOfMonth(year, month, day){
// Output should be like this
2022-02-23
(this is last Wednesday of the month, according to the arguments
我正在尝试一个日期,在js中返回我已经过去的年月,但我得到它只是为了告诉我的日子。
$("#nacimiento").change(function(){
var nacimiento=$("#nacimiento").val();
var fechaInicio = new Date(nacimiento).getTime();
var fechaFin = new Date('<? echo date("Y-m-d");?>').getTime();
var dif