Full version: jsB@nk » Time » Calendar » Calendar Block script
URL: https://www.javascriptbank.com/calendar-block-script.html
Use this JavaScript to display the calender block and greeting message on your webpages.
Full version: jsB@nk » Time » Calendar » Calendar Block script
URL: https://www.javascriptbank.com/calendar-block-script.html
<script language="JavaScript"><!-- Beginvar Today=new Date();var ThisDay=Today.getDay();var ThisDate=Today.getDate();var ThisMonth=Today.getMonth()+1;var ThisYear=Today.getFullYear(); //included if you wish to insert the yearfunction DayTxt (DayNumber) {var Day=new Array();Day[0]="Sunday";Day[1]="Monday";Day[2]="Tuesday";Day[3]="Wednesday";Day[4]="Thursday";Day[5]="Friday";Day[6]="Saturday";return Day[DayNumber];}var DayName=DayTxt(ThisDay);function MonthTxt (MonthNumber) {var Month=new Array();Month[1]="January";Month[2]="February";Month[3]="March";Month[4]="April";Month[5]="May";Month[6]="June";Month[7]="July";Month[8]="August";Month[9]="September";Month[10]="October";Month[11]="November";Month[12]="December";return Month[MonthNumber];}var MonthName=MonthTxt(ThisMonth);var d = new Date();var h = d.getHours();document.write("<TABLE BORDER=3 BGCOLOR=WHITE WIDTH=150 HEIGHT=85>"+"<TD>"+"<p align=center>"+"<font size=-2 >"+DayName+"<br>"+"<font color=orangered size=+3>"+ThisDate+"</font><br>"+MonthName+"<br>"+"</b>"+"</font>"+"</p>");if (h < 2) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Yes, it's way past midnight."+"</b>"+"</P>");else if (h < 3) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up early or working late?"+"</b>"+"</P>");else if (h < 7) document.write("<P ALIGN=center>"+"<b>"+"Good morning! Up bright and early!"+"</b>"+"</P>");else if (h < 12) document.write("<P ALIGN=center>"+"<b>"+"Good morning!"+"</b>"+"</P>");else if (h < 17) document.write("<P ALIGN=center>"+"<b>"+"Good afternoon!"+"</b>"+"</P>");else if (h < 23) document.write("<P ALIGN=center>"+"<b>"+"Good evening!"+"</b>"+"</P>");else document.write("<P ALIGN=center>"+"<b>"+"A late good evening! Not much left of it now."+"</b>"+"</P>");document.write("</TD>"+"</TR>"+"</TABLE>");// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->