gradinumcp
IS-IT--Management
Hi! I have a piece of code where the user picks a date from the calendar. Depending on the date he has picked, it should display all the days of the week.
Example: If the user picked 18th October 2005 from the calendar, then it should display:
Sunday 10/16/2005
Monday 10/17/2005
Tuesday 10/18/2005
Wednesday 10/19/2005
Thursday 10/20/2005
Friday 10/21/2005
Saturday 10/22/2005
I know this can be displayed if the date picked is todays date by using <%=Date()-Weekday(Date())+1%> for Sunday and so on.
However how do i accomplish this when the Date is what the user has picked--so kind of change Date() to say <%=request("PullDate")%>--but what would be the correct code for that??
Here's my code:
<td>Week<input class=fields readonly name="PullDate" <% if request("PullDate")<>"" then %>value="<%=request("PullDate")%>"<% else %>value="<%=Date()%>"<% end if %>
Sunday=<%=Date()-Weekday(Date())+1%>
Monday=<%=Date()-Weekday(Date())+2%>
Tuesday=<%=Date()-Weekday(Date())+3%>
Wednesday=<%=Date()-Weekday(Date())+4%>
Thursday=<%=Date()-Weekday(Date())+5%>
Friday=<%=Date()-Weekday(Date())+6%>
Saturday=<%=Date()-Weekday(Date())+7%>
Example: If the user picked 18th October 2005 from the calendar, then it should display:
Sunday 10/16/2005
Monday 10/17/2005
Tuesday 10/18/2005
Wednesday 10/19/2005
Thursday 10/20/2005
Friday 10/21/2005
Saturday 10/22/2005
I know this can be displayed if the date picked is todays date by using <%=Date()-Weekday(Date())+1%> for Sunday and so on.
However how do i accomplish this when the Date is what the user has picked--so kind of change Date() to say <%=request("PullDate")%>--but what would be the correct code for that??
Here's my code:
<td>Week<input class=fields readonly name="PullDate" <% if request("PullDate")<>"" then %>value="<%=request("PullDate")%>"<% else %>value="<%=Date()%>"<% end if %>
Sunday=<%=Date()-Weekday(Date())+1%>
Monday=<%=Date()-Weekday(Date())+2%>
Tuesday=<%=Date()-Weekday(Date())+3%>
Wednesday=<%=Date()-Weekday(Date())+4%>
Thursday=<%=Date()-Weekday(Date())+5%>
Friday=<%=Date()-Weekday(Date())+6%>
Saturday=<%=Date()-Weekday(Date())+7%>