worried-musician-44929
08/02/2023, 9:59 AM${year}-${month}-${day}
));
if (!isValidDate) {
// The provided date is not valid
return false;
}
// Get the current date and time (with time set to midnight)
const today = new Date();
today.setHours(0, 0, 0, 0);
// Calculate the time difference between today and the input date in milliseconds
const timeDifference = Date.parse(${year}-${month}-${day}
) - today.getTime();
// Convert the time difference to days
const daysDifference = timeDifference / (1000 * 60 * 60 * 24);
// Check if the days difference is less than or equal to 100
return daysDifference >= 0 && daysDifference <= 100;
But it is not working since if I keep 2023-08-03.It doesnt return true.Why is that?acceptable-kangaroo-64719
08/02/2023, 11:13 AMworried-musician-44929
08/03/2023, 10:10 AMhttps://cdn.discordapp.com/attachments/1136236910252150824/1136602035538628628/Screenshot_95.png▾
acceptable-kangaroo-64719
08/03/2023, 10:34 AMworried-musician-44929
08/03/2023, 1:22 PMacceptable-kangaroo-64719
08/03/2023, 1:39 PM