js check if date is future

JavaScript
var now = new Date();
if (before < now) {
  // selected date is in the past
}
Source

Also in JavaScript: