Date now greater than date value given
<p>I am having to try to determine whether a date from a hidden field, formatted mm/dd/yyyy, is less than today. if it is, I want to let the person know that a subscription has expired. I have had this working on some occasions but it is not reliably doing it??</p>

<pre><code>//this is the expiration date that is in a hidden field
var expireDate = $("#expire").val();

//here I am trying to setup a new date for today and change the output to match the date
//format for the hidden field, i.e. mm/dd/yyyy
var a = new Date();
var b = a.toISOString().split("T")[0].split("-");
var ca = b[1] + "/" + b[2] + "/" + b[0];


//now I want to compare the 2 and if the expiration date is less than today, display a warning message                      
if (expireDate &lt; ca) {
   $("&lt;div class=\"message-warning\"&gt;This subscription is expired&lt;/div&gt;")
    .insertAfter("#enddate");
};
</code></pre>
