Javascript Date manipulation
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1187824/finding-date-by-subtracting-x-number-of-days-from-a-particular-date-in-javascrip">Finding date by subtracting X number of days from a particular date in Javascript</a>  </p>
</blockquote>



<p>I have a <a href="http://stefangabos.ro/jquery/zebra-datepicker/" rel="nofollow">jQuery datepicker</a> which allows users to pick a Friday from any given week. I want to populate fields based off that Friday and input the dates from Mon-Thurs as well.</p>

<p>I.e. the user picks this coming Friday (10-26-2012), I want to subtract from the day by 1 to get Thursday date, and then Wed, etc etc.</p>

<p>How would I approach this?</p>

<pre><code>    $(document).ready(function(){
        $("#friDate").Zebra_DatePicker({
            format: 'm-d-Y',
            disabled_dates: ['* * * 0-4,6'],
            first_day_of_week: 0,
            onSelect: function(){
                var date = $("#friDate").val();
                $("#mon").val('INSERT MON DATE');
                $("#tue").val('INSERT TUE DATE');
                $("#wed").val('INSERT WED DATE');
                $("#thu").val('INSERT THU DATE');
                $("#fri").val(date);                    
            }
        });
    });
</code></pre>

<p>Any help is greatly appreciated! Thanks :).</p>
