[Main] [Lottery] [DVD's] [Travel] [Web Design] [Downloads] [Guestbook] [About]


WIDTH: HEIGHT:
Abbreviate Day Names
<% '**************************************************************** ' If the form is being visited for the first time this code will ' not execute '**************************************************************** If Len(Request.Form("MONTH")) then '******************************************************************* ' Open text file and extract memo information and store in arrays '******************************************************************* Redim aMemoInfo(0) Redim aMemoDate(0) arrIndex = 0 Set FSO = CreateObject("Scripting.FileSystemObject") Set File = FSO.GetFile(Server.MapPath("\ASP_Source\Calendar") & "/memo.txt") Set TextStream = File.OpenAsTextStream(1) Do While Not TextStream.AtEndOfStream S = TextStream.ReadLine aMemoDate(arrIndex) = Left(S,InStr(1,S,";")-1) aMemoInfo(arrIndex) = Right(S,Len(S)-InStr(1,S,";")) arrIndex = arrIndex + 1 Redim Preserve aMemoInfo(arrIndex) Redim Preserve aMemoDate(arrIndex) Loop TextStream.Close Redim Preserve aMemoInfo(arrIndex-1) Redim Preserve aMemoDate(arrIndex-1) '************************************* ' Editable list of Public holidays '************************************* arrPublic = array("2001/03/21","2001/04/13","2001/04/16","2001/04/27","2001/05/01","2001/06/16","2001/08/09","2001/09/24","2001/12/16","2001/12/25","2001/12/26","2002/01/01","2001/01/01") '************************************* ' Get the cell dimensions '************************************* 'Const CELL_WIDTH = 100 'Const CELL_HEIGHT = 100 CELL_WIDTH = Request.Form("CELLW") CELL_HEIGHT = Request.Form("CELLH") '************************************* ' Must the Day Names be abbreviated '************************************* 'blnAbbr = TRUE blnAbbr = Request.Form("ABB") dtSelected = Request.Form("YEAR") &"/" &Request.Form("MONTH") &"/1" datetime = dtSelected '****************************************************************** ' Work out the number of days in the month that was submitted '****************************************************************** datetime = dateadd("d", -datepart("d",datetime)+1,datetime) datetime = dateadd("m", 1, datetime) datetime = dateadd("d", -1, datetime) intDays = datepart("d",datetime) '**************************************************************** ' CALENDAR HEADER '**************************************************************** %>
<% For I = 1 to 7 Response.Write "" Next %> <% '**************************************************************** 'Use intCounter to see how many cells have been written out '**************************************************************** For I = 1 to Weekday(dtSelected)-1 Response.Write "" intCounter = intCounter + 1 Next If intCounter-1 >= 7 then intCounter = 0 Response.Write "" End if For I = 1 to intDays blnISPublic = FALSE intCounter = intCounter + 1 newdate = Request.Form("YEAR") &"/" &Request.Form("MONTH") &"/" &I For J = 0 to UBOUND(arrPublic) If CDate(NewDate) = CDate(arrPublic(J)) then blnIsPublic = TRUE End if Next If CDate(NewDate) = DATE then strCLASS = "TODAY" elseif blnIsPublic then strCLASS = "PUBLIC" else strCLASS = "DAYS" end if '**************************************************************** ' Write out data '**************************************************************** For J = 0 to UBOUND(aMemoDate) If CDate(aMemoDate(J)) = CDate(NEWDATE) then strIMG = "
"&aMemoInfo(J) &"" exit For else strIMG = " " End if Next if intCounter mod 7 <> 0 then Response.Write "
" else Response.Write "" end if Next %>
<%=MONTHNAME(Request.Form("MONTH")) &" - " &Request.Form("YEAR")%>
" &WeekdayName(I,blnAbbr) &"
 
" &I &strIMG &"" &I &strIMG &"
TodayPublic Holiday
<% end if%>

Let me know what you think of the code and tell me if you are using it.
Cool ASP Development