What's Here?
- Members: 300,308
- Replies: 825,514
- Topics: 137,361
- Snippets: 4,417
- Tutorials: 1,147
- Total Online: 2,097
- Members: 128
- Guests: 1,969
|
|
Submitted By: root_hacker
|
|
Rating:

|
|
Views: 7,664 |
Language: ASP
|
|
Last Modified: June 25, 2005 |
|
Instructions: copy paste code |
Snippet
Ok here is the month view of asp calander written by me and only me
Code start from line below
=================
<%
function tagdates
End function
function drawcalander
'===================== calculating values for drawing calander
if request.QueryString("date")="" then
current_date=date()
else
current_date=request.QueryString("date")
End if
current_month=month(current_date)
current_year=year(current_date)
current_day=day(current_date)
first_day_month=day(dateserial(current_year,current_month,01))
last_day_month=day(dateserial(current_year,current_month+1,1-1))
weekday_monthfirst=weekday(dateserial(current_year,current_month,01))
weekday_today=weekday(dateserial(current_year,current_month,current_day))
'======================================
'response.write "<br>current date ="¤t_date&"<br>"
'response.write "<br>current month ="¤t_month&"<br>"
'response.write "<br>year ="¤t_year&"<br>"
'response.write "<br>todays date ="¤t_day&"<br>"
''response.write "<br>first day of month ="&first_day_month&"<br>"
'response.write "<br>last day of month is ="&last_day_month&"<br>"
'response.write "<br>weekday position of first day="&weekday_monthfirst&"<br>"
'response.write "<br>weekday position of todayss day="&weekday_today&"<br>"
' response.write "<br>first day of fiven week is="&dateadd("d",-(weekday_today-1),current_date)&"<br>"
response.write "<table border=1>"
response.write "<tr>"
response.write "<td colspan=7>"
response.write "<a href=test.asp?date="&dateadd("m",-1,current_date)&"><<</a> "
response.write monthname(current_month)&", "¤t_year
response.write " <a href=test.asp?date="&dateadd("m",+1,current_date)&">>></a>"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
response.write "<td>"
response.write "S"
response.write "</td>"
response.write "<td>"
response.write "M"
response.write "</td>"
response.write "<td>"
response.write "T"
response.write "</td>"
response.write "<td>"
response.write "W"
response.write "</td>"
response.write "<td>"
response.write "Th"
response.write "</td>"
response.write "<td>"
response.write "F"
response.write "</td>"
response.write "<td>"
response.write "Sa"
response.write "</td>"
response.write "</tr>"
response.write "<tr>"
for i=1 to 7
if i>weekday_monthfirst-1 then
response.write "<td>"
days=days+1
response.write days
response.write "</td>"
else
response.write "<td>"
response.write " "
response.write "</td>"
End if
next
for j=1 to 5
response.write "<tr>"
for i=1 to 7
if days<last_day_month then
days=days+1
response.write "<td>"
response.write days
response.write "</td>"
End if
Next
response.write "</tr>"
Next
response.write "</tr>"
response.write "</table>"
End function
function najam
'response.write "inside function"
a="najam is great"
najam=a
end function
%>
<%
a=najam
drawcalander
%>
Copy & Paste
|
|
|
|