Is Date before that inputted?

Is Date before that inputted?

by Andrew Pougher

HTML

<input type="text" placeholder="Monday, June 28, 2012"/><label> IS BEFORE <code id="bookingdate">Monday, May 11, 2010</code>. (the start date on the calendar)
  <br>
<span></span>
<br>
<button>RUN</button>
<br>
<div id="liveview"></div>

CSS

body{padding:20px;}

input{padding:4px 24px 4px 14px;font-size:22px;outline:none;border-radius:4px;margin:4px;width:61%}

span{color:blue}

JavaScript

function isPastDate(value) {
    var bookinglistdate =   $("#bookingdate").text();
  var inputValue =  $.datepicker.parseDate('DD, MM d, yy', bookinglistdate);

  var target = new Date(value);
if (target.getFullYear() < inputValue.getFullYear()) {
    return true;
  }
  else if (target.getMonth() < inputValue.getMonth()) {
    return true;
  }
  else if (target.getDate() <= inputValue.getDate()) {
    return true;
  }
      else if (target.getDate() == inputValue.getDate()) {
    return exact;
  }
  return false;
}




$("button").live('click', function(){
$('input').focus();
    var f = $('input').val();
// id the inputted date older than that in the 
var m = $.datepicker.parseDate('DD, MM d, yy', $("input").val());
$("span").text( isPastDate((m).toString() ));
    
    if($("span").text() == true.toString()){
    $("#liveview").text(f + " will be hidden from your calendar").fadeTo('slow', 0.3);
    }else{
        $("#liveview").text(f + " will NOT be hidden from your calendar").fadeTo('slow', 1);
    }
    
});