»
EnglishFrenchVietnamese

Print - Born Which Day script - JavaScriptBank.com

Full version: jsB@nk » Time » Birthday » Born Which Day script
URL: https://www.javascriptbank.com/born-which-day-script.html

Born Which Day script © JavaScriptBank.comI'm sure most of you are curious about what day of the week you were born. This script will tell you exactly that - in a nice layout, as well. Now, you know.

Full version: jsB@nk » Time » Birthday » Born Which Day script
URL: https://www.javascriptbank.com/born-which-day-script.html



JavaScript
<SCRIPT language=JavaScript><!--function cala_day(form) {                var nSwitch = 0        var nMonth = parseInt(form.month.value)        var nDay =  parseInt(form.day.value)        var nYear =  parseInt(form.year.value)                if(!(nYear % 4) && (nMonth > 2)) {                nSwitch = 1        }                       var nDayOfWeek = cala_weekday(nMonth, nDay, nYear)                if(nSwitch) {                nDayOfWeek++                nSwitch = 0        }                day_display(form, nDayOfWeek)}function cala_weekday( x_nMonth, x_nDay, x_nYear) {        if(x_nMonth >= 3){                      x_nMonth -= 2        }        else {                x_nMonth += 10        }        if( (x_nMonth == 11) || (x_nMonth == 12) ){                x_nYear--        }        var nCentNum = parseInt(x_nYear / 100)        var nDYearNum = x_nYear % 100                var nPart1 = parseInt(2.6 * x_nMonth - .2)                var nZeller = (parseInt(nPart1 + x_nDay + nDYearNum + (nDYearNum / 4) + (nCentNum / 4) - 2 * nCentNum)) % 7                if(nZeller < 0){                nZeller += 7        }                return nZeller}function day_display(form, x_nDayOfWeek) {        if(x_nDayOfWeek == 0) {                form.birthday.value = "Saturday"                return        }        if(x_nDayOfWeek == 1) {                form.birthday.value = "Sunday"                return        }        if(x_nDayOfWeek == 2) {                form.birthday.value = "Monday"                return        }        if(x_nDayOfWeek == 3) {                form.birthday.value = "Tuesday"                return        }        if(x_nDayOfWeek == 4) {                form.birthday.value = "Wednesday"                return        }        if(x_nDayOfWeek == 5) {                form.birthday.value = "Thursday"                return        }        if(x_nDayOfWeek == 6) {                form.birthday.value = "Friday"                return        }        form.birthday.value = "Not a valid date."}//--></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<TABLE border=0 cellPadding=5 cellSpacing=5 width="96%">  <TBODY>  <TR>    <TD width="100%">      <FORM>      <DIV align=center>      <CENTER>      <TABLE align=center border=1 width=225>        <TBODY>        <TR>          <TD align=middle bgColor=#0000ff colSpan=2 width=250><FONT             color=#ffffff face=ARIEL,HELVETICA size=-1><B>When were you born?</B></FONT><FONT face=ARIEL,HELVETICA size=-1></FONT></TD></TR>        <TR>          <TD bgColor=#ff0000 width=100><FONT size=2><B><FONT             color=#ffff00>Month:</FONT></B><INPUT name=month             size=4><BR><BR><B><FONT color=#ffff00>Date:</FONT></B><INPUT             name=day size=4><BR><BR><B><FONT color=#ffff00>Year:</FONT></B><INPUT             name=year size=4></FONT> </TD>          <TD align=middle bgColor=#ff0000 width=125><FONT             color=#ffff00><BR><FONT size=2><B>Ex:</B></FONT> <BR><FONT             size=2><I><B>07-06-1986</B><BR><B>Sunday</B></I><BR><BR><B>You were born:</B></FONT> <BR><INPUT name=birthday size=10> </FONT></TD></TR>        <TR>          <TD align=middle bgColor=#0000ff colSpan=2><INPUT onclick=cala_day(this.form) type=button value=OK><INPUT type=reset value=Reset></FONT></TD></TR></TBODY></TABLE></CENTER></DIV></FORM></TD></TR></TBODY></TABLE><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->