validate if date is before date of current date
<p>// using this function i m getting 7 days difference how i calculate if date is before date of current date
           //means i have to validate if date is before date of current date.    </p>

<pre><code>function validateDate()
            {
                pickedDate = Date.parse("05-Jul-2012".replace(/-/g, " "));
                todaysDate = new Date();
                todaysDate.setHours(0, 0, 0, 0);
                dateDifference = Math.abs(Number(todaysDate) - pickedDate);
                //7 Days=604800000ms
                if (dateDifference &gt; 604800000)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
</code></pre>
