I'm trying to make a few different alerts based on date input. The jquery calendar puts the date in this format:
Is there a way to pop an alert "may or may not be possible " if the date is between 3 and 5 days in the future, alert "date is unavailable" if less than three days in the future. and alert "date is in the past" if it is in the past"?
What I have started is basically just to collect my date from the input field, and set up a few variables.. ><
var selected_date = $('#ship_date').val();
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var hours = currentTime.getHours();
//document.write(month + "/" + day + "/" + year)
I don't know how to deal with days that roll around into different months. And also, how to treat the 3 day period as the next day if the current time is, say, after 14:00. I appreciate it if you can help me figure out this complex problem!