I have a checkbox question with various times of day (12:30pm, 1:00pm, etc.) where users can sign up for a particular time for an appointment. I also have a date selector question. If the users selects today's date, I want to be able automatically remove times that have already passed, and ones that are too close to the current time. For example, if it is currently 10:55am, I want 9:00am, 9:30am, 10:00am, and 10:30am to not display. I also want 11:00am to not display since it is too close to the current time.
I am pulling the system time here:
// get system time
var d = new Date();
var m = d.getMinutes();
var h = d.getHours();
if(h == '0') {h = 24}
var currentTime = h+":"+m;
colsole.log('The current time is ' + currentTime + '.');
Is there a way to do this? Thank you!!
Question
How can I compare options (times of day) to the current time?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
