Full version: jsB@nk » Time » Find Friday the 13th's!
URL: https://www.javascriptbank.com/find-friday-the-13th.html
This will display all the Friday the 13th's for a range of years. You may also select a certain month to review! Awesome show of how to interpret and change the date parameters within javascript!
Full version: jsB@nk » Time » Find Friday the 13th's!
URL: https://www.javascriptbank.com/find-friday-the-13th.html
<script>// Find Friday the 13th// Donnie Brewer , [email protected] , http://jscript.brewskynet.com/fridayvar new_Date=new Date()//var DOW=new_Date.getDay()+1var DOM=new_Date.getDate()//var Month=new_Date.getMonth()+1var Year=new_Date.getFullYear()var LongMonth = new Array("January","February","March","April","May","June","July","August","September","October","November","December")var LongDay = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")var setTimer = 5000;function find13th() {var Start = startyear.valuevar End = endyear.valuevar TooMuch = End-Start//alert(TooMuch)if (confirm("Caution, this may result in an extremely large result, and may take a long time to display those results."))if (End < Start)//if end<start alert user, elsealert("Sorry, the ending year must be greater than or equal to the beginning year..")else {//allow dates and continuevar BasicHTML = "<center><u>Results!!</u>"for (YearTest=Start;YearTest<=End;YearTest++) {if (MonthSelect.value==20) {for (MonthTest=0;MonthTest<=11;MonthTest++) {var TestDate = new Date(YearTest,MonthTest,13)if (TestDate.getDay()==5)BasicHTML = BasicHTML+"<br>"+LongMonth[MonthTest]+" "+TestDate.getDate()+", "+YearTest}}else {var TestDate = new Date(YearTest,MonthSelect.value,13)if (TestDate.getDay()==5)BasicHTML = BasicHTML+"<br>"+LongMonth[MonthSelect.value]+" "+TestDate.getDate()+", "+YearTest}}document.all["InternalDiv"].innerHTML = BasicHTML;}else {alert("Please make the years closer together..")}}function clearResults() {var BasicHTML = "<center>Results will be posted here!!</center>"document.all["InternalDiv"].innerHTML = BasicHTML;}</script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
Enter beginning year: <input type="text" size="5" maxlength="4" name="startyear" value="2002"><br><br>Enter ending year: <input type="text" size="5" maxlength="4" name="endyear" value="2002"><br><br>You may also select by a particular month: <select name="MonthSelect" size="1" style="height: 22px; width: 130px;"><option value="20" selected="selected">None Preferred</option><option value="0">January</option><option value="1">February</option><option value="2">March</option><option value="3">April</option><option value="4">May</option><option value="5">June</option><option value="6">July</option><option value="7">August</option><option value="8">September</option><option value="9">October</option><option value="10">November</option><option value="11">December</option></select><br><br><input type="button" value="Find" onmouseup="find13th()"> <input type="button" value="Clear Result List" onmouseup="clearResults()"><layer id="Layer1"></layer><div id="InternalDiv"></div><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->