I'm new to Javascript. The code below compare both date and time. I wanted to make a function where user can only claim the coins once for each day. However, when user claims the coins on the next day, the button is still disabled because the code below follow the time that user last claimed their coins. I've tried so many ways but it still comparing both date and time. Anyone knows on how to compare the date without time?
$(document).ready(function () {
if (new Date(model[0].lastClaimedDate) < new Date()) {
document.getElementById('btnAddCoins').disabled = false;
}
else {
document.getElementById('btnAddCoins').disabled = true;
}
})