Snippet
ok guys i asked about calander in asp here is the one i write it by myslef
thank u thank u
u can sit down now
Following is the week view
=================
Copy whole code give 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))
first_day_week=dateadd("d",-(weekday_today-1),current_date)
last_day_week=dateadd("d",first_day_week+6,current_date)
'======================================
'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=week.asp?date="&dateadd("d",-(weekday_today),current_date)&"><<</a> "
response.write monthname(current_month)&", "¤t_year
response.write " <a href=week.asp?date="&dateadd("d",+(weekday_today),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>"
days=day(first_day_week)
tmpdays=first_day_week
for i=1 to 7
'if days>=first_day_month and days<=last_day_month then
response.write "<td>"
response.write day(tmpdays)
response.write "</td>"
tmpdays=dateadd("d",+1,tmpdays)
'else
'response.write "<td>"
'response.write " "
'response.write "</td>"
'End if
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
'response.write "<br>"&a
%>
-
Copy & Paste
|