He estado buscando y la solución que encontré me da error me sale que el check.getDate no es una función. Este es mi código donde recoge el día donde hago click en un fullcalendar.
var check = info.dateStr;
check = Date.parse(check)
var months = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
var days = ["0","01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"];
var today = new Date();
today = today.getUTCFullYear()+"-"+months[today.getUTCMonth()]+"-"+days[today.getUTCDate()];
check = check.setDate(check.getDate() - limite)
alert(check);
if( check < today )
{
Swal.fire(
'Vaya parece que llegas tarde',
'Deberias selecionar una fecha disponible',
'error'
)
}
Donde limite es una variable que tengo global con un valor de 3
check.getTime() < today.getTime()
para saber que la fechacheck
es menor. Comenta esto primerotoday = today.getUTCFullYear()+"-"+months[today.getUTCMonth()]+"-"+days[today.getUTCDate()];