waiting12345
Technical User
Hi, I'm trying to create a simple calendar script, what I want to be able to do is loop through all the weeks as the rows and then the days in the week as columns. My problem lies in that the counter starts at 1 which means the first day appears always on monday which is not the case. I'd appreciate if someone could help adjust this to work properly. One final thing to mention is that it's pretty imperitive that I don't have a seperate loop for the first week as i'm eventually going to add some pretty hefty work inside the table and don't want to load it twice. Cheers
Code:
<%
' loop for the remaining weeks in the month
vblvntDayCounter = 0
for vblvntWeeks = 1 to 5 %>
<tr>
<%
' loop for the remaing days of the month
for vblvntCounter = 1 to 7
vblvntDayCounter = vblvntDayCounter + 1
' write out the date and place in bold if it's the current date
if vblvntDayCounter <= vblvntLastDay then %>
<td align="center"><%=vblvntDayCounter%></td>
<% end if
next %>
</tr>
<% next %>