Dates are kinda problematic in JavaScript. Most common approach is to grap a framework that handles time related stuf like moment.js.
You need to ensure the format, that the user can input this date. Therefore it would be a good approach to split it up into three select boxes (Month, Day, Year). So you can always expect the input to be in the same format.
Next step will be to grap the current time with moment's now()
var now = moment();
After that you need to compare the time the user entered to now.
Therefor the next step is to turn the users input into a moment
var userInput = moment(inputYear + "-" + inputMonth + "-" + inputDay);
Notice: The format you are passing in here is related to your chosen timezone inside moment.js.
Then you could go on and compare the two moments.
now.diff(userInput);
So your final code could look like
...
var now = moment();
var userInput = moment(inputYear + "-" + inputMonth + "-" + "inputDay);
if(now.diff(userInput)) {
// your code here
}
...
Hope this is helpful to you!