i am breaking my head over this and there isnt any good solution that i have saw til now, my problam is that i want to tell the date of a sertin day what was choosen
[HTML]<select id="7_day" name ="7days">
<option value="0">Sunday</option>
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
</selectt>[/HTML]
when the user choose one of this days i will be able to get the date of all the last 5 sunday's for example
the problam i am getting is when trying to minus 7 out of the:
Expand|Select|Wrap|Line Numbers
- today = new Date();
- alert(today.getDate()-7 )
Expand|Select|Wrap|Line Numbers
- alert (today.getDate()-28)
i dont want to calculate it as intgers i want to calculate it as dates is it possible?? in php i would use mktime but js dont have it :(
somthing like that :
Expand|Select|Wrap|Line Numbers
- <?php
- $date= date("Y-m-d");
- $day = explode("-",$date);
- $lastWeek= strftime("%Y-%m-%d",(mktime(0,0,0,$day[1],$day[2]-7,$day[0])));
- ?>