jarv
08-02-2007, 01:54 PM
I really need help with my ASP calendar, I have SET DATEFORMAT dmy When i hover over a date past 13/08/07 that should be 13th August 2007 and it is! before that date on my calendar 12th, 11th, 10th etc changed and becomes months not days so for example when i hover over the 12 on calendar that shows 8th December 2007??! please help, here is the code i think needs tweaking...
<%
' Initialize the end of rows flag to false
EndRows = False
Response.Write vbCrLf
' Loop until all the rows are exhausted
Do While EndRows = False
' Start a table row
Response.Write " <TR>" & vbCrLf
' This is the loop for the days in the week
For intLoopDay = cSUN To cSAT
' If the first day is not sunday then print the last days of previous month in grayed font
If intFirstWeekDay > cSUN Then
Write_TD LastMonthDate, "NON"
LastMonthDate = LastMonthDate + 1
intFirstWeekDay = intFirstWeekDay - 1
' The month starts on a sunday
Else
' If the dates for the month are exhausted, start printing next month's dates
' in grayed font
If intPrintDay > intLastDay Then
Write_TD NextMonthDate, "NON"
NextMonthDate = NextMonthDate + 1
EndRows = True
Else
' If last day of the month, flag the end of the row
If intPrintDay = intLastDay Then
EndRows = True
End If
dToday = CDate(intPrintDay & "/" & intThisMonth & "/" & intThisYear)
If NOT Rs.EOF Then
' Set events flag to false. This means the day has no event in it
bEvents = False
Do While NOT Rs.EOF AND bEvents = False
' If the date falls within the range of dates in the recordset, then
' the day has an event. Make the events flag True
If dToday = Rs("Start_Date") Then
' Print the date in a highlighted font
Write_TD "<A HREF=events.asp?date="& Server.URLEncode(dToday) & " CLASS='EVENT' > " & intPrintDay & "</A>", "HL"
bEvents = True
' If the Start date is greater than the date itself, there is no point
' checking other records. Exit the loop
ElseIf dToday < Rs("Start_Date") Then
Exit Do
' Move to the next record
Else
Rs.MoveNext
End If
Loop
' Checks for that day
Rs.MoveFirst
End If
' If the event flag is not raise for that day, print it in a plain font
If bEvents = False Then
Write_TD "<A HREF=events.asp?date="& Server.URLEncode(dToday) & " CLASS='NOEVENT' > " & intPrintDay & "</A>", "SOME"
End If
End If
' Increment the date. Done once in the loop.
intPrintDay = intPrintDay + 1
End If
' Move to the next day in the week
Next
Response.Write " </TR>" & vbCrLf
Loop
Rs.Close
Set Rs = Nothing
%>
<%
' Initialize the end of rows flag to false
EndRows = False
Response.Write vbCrLf
' Loop until all the rows are exhausted
Do While EndRows = False
' Start a table row
Response.Write " <TR>" & vbCrLf
' This is the loop for the days in the week
For intLoopDay = cSUN To cSAT
' If the first day is not sunday then print the last days of previous month in grayed font
If intFirstWeekDay > cSUN Then
Write_TD LastMonthDate, "NON"
LastMonthDate = LastMonthDate + 1
intFirstWeekDay = intFirstWeekDay - 1
' The month starts on a sunday
Else
' If the dates for the month are exhausted, start printing next month's dates
' in grayed font
If intPrintDay > intLastDay Then
Write_TD NextMonthDate, "NON"
NextMonthDate = NextMonthDate + 1
EndRows = True
Else
' If last day of the month, flag the end of the row
If intPrintDay = intLastDay Then
EndRows = True
End If
dToday = CDate(intPrintDay & "/" & intThisMonth & "/" & intThisYear)
If NOT Rs.EOF Then
' Set events flag to false. This means the day has no event in it
bEvents = False
Do While NOT Rs.EOF AND bEvents = False
' If the date falls within the range of dates in the recordset, then
' the day has an event. Make the events flag True
If dToday = Rs("Start_Date") Then
' Print the date in a highlighted font
Write_TD "<A HREF=events.asp?date="& Server.URLEncode(dToday) & " CLASS='EVENT' > " & intPrintDay & "</A>", "HL"
bEvents = True
' If the Start date is greater than the date itself, there is no point
' checking other records. Exit the loop
ElseIf dToday < Rs("Start_Date") Then
Exit Do
' Move to the next record
Else
Rs.MoveNext
End If
Loop
' Checks for that day
Rs.MoveFirst
End If
' If the event flag is not raise for that day, print it in a plain font
If bEvents = False Then
Write_TD "<A HREF=events.asp?date="& Server.URLEncode(dToday) & " CLASS='NOEVENT' > " & intPrintDay & "</A>", "SOME"
End If
End If
' Increment the date. Done once in the loop.
intPrintDay = intPrintDay + 1
End If
' Move to the next day in the week
Next
Response.Write " </TR>" & vbCrLf
Loop
Rs.Close
Set Rs = Nothing
%>