[waug] Re: Website and other stuff?

  • From: incerti auctoris <incertia@xxxxxxxxxxx>
  • To: <waug@xxxxxxxxxxxxx>
  • Date: Tue, 11 Dec 2007 15:15:59 +0000

I have a bugfix of my own, for Mark's date-finding javascript:
Dates for the 2nd Saturday of the month can only be 8-14 inclusive: All 
th's!!So no st/nd/rd necessary.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";><HTML lang="en-GB"><HEAD><META 
http-equiv="Content-Type" content="text/html; 
charset=ISO-8859-1"><HTML><HEAD><TITLE>Autocalendar</TITLE></HEAD><BODY>
<P><!--May be replaced with H1 etc.--><SCRIPT type="text/javascript"><!--// 
Second Saturday of the month.// Generates and tests a specific test date, 
instead of using fixed presets.
var dn=new 
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');var
 mn=new 
Array('January','February','March','April','May','June','July','August','September','October','November','December');//
 Dates for the 2nd Saturday of the month, can only be 8-14 inclusive: All 
th's!!z=' ';th='<SUP>th</SUP> ';ln="<BR>\n";Sat='Saturday ';d_=document;
today=new 
DateMM=today.getMonth();DD=today.getDate();OY=today.getFullYear();Year=OY;
d_.write("The next meeting is ");i=MM+1;S=(7-(new 
Date(Year,i-1,1).getDay()))+7;if(S<=DD) {i++;if(i>12){i=1;Year++;}}S=(7-(new 
Date(Year,i-1,1).getDay()))+7;
if(i==MM && Year==OY){if(S==DD) d_.write("Today!<BR>\n");if(S==DD+1) 
d_.write("Tomorrow!<BR>\n");}elsed_.write("on Saturday 
"+S+th+mn[i-1]+z+Year+ln);
//--></SCRIPT>
<HR><!--Middling gubbins.-->
 
<SCRIPT type="text/javascript"><!--
d_.write("<P>Dates for the next 12 months:\n");d_.write("<TABLE 
border=0>\n");d_.write("<TR><TD align=right>\n");if(S<=DD) 
i++;for(j=1;j<=12;j++){i++;if(i>12){i=1;Year++;}S=(7-(new 
Date(Year,i-1,1).getDay()))+7;d_.write(Sat+S+th+mn[i-1]+z+Year+ln);if(j==6)d_.write("<TD>
 &nbsp; &nbsp; <TD align=right>\n");}d_.write("</TABLE>\n");
//--></SCRIPT>
<!--Postscript/postcode.-->
</BODY>
 
I could write a php version if you like, but that wouldn't work terriblywell 
offline, so I didn't bother for now. Maybe just for auto-writing theNOSCRIPT 
part. This javascript will work for all years without adjustment.I have tested 
on IE, but not FF yet.
I have also found thathttp://www.mfraz.freeserve.co.uk/waug/or 
indeedhttp://www.mfraz.freeserve.co.uk/Does not display for me anymore.
Yours Sincerely,Robin Hodson (Mr.)Tel. 07811 550086http://freedom.is/better/blog
_________________________________________________________________
Who's friends with who and co-starred in what?
http://www.searchgamesbox.com/celebrityseparation.shtml

Other related posts: