Javascript to Find Second and Fourth Saturday

Find Second and Fourth Saturday for the selected month and year using this javascript.

Features

  • Use this java script to find second and fourth saturday of particular month and year.
  • This code supports all browsers.

Preview

Select Month:
Select Year:
Second Saturday:
Fourth Saturday:
©h

Downloads

Javascript

<!-- Script by hscripts.com -->
<script type="text/javascript">
function calculate()
{
var mon=document.getElementById('month').value;
var yea=document.getElementById('year').value;
var dat=1;
myDays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
myDate=new Date(eval('"'+dat+','+mon+','+yea +'"'))
var first=myDays[myDate.getDay()];
var secnd;
var forth;
switch(first)
{case "Sunday":secnd = "14th,"+mon+','+yea;forth = "28th,"+mon+','+yea;break;case "Monday":secnd = "13th,"+mon+','+yea;forth = "27th,"+mon+','+yea;
break;case "Tuesday":
secnd ="12th,"+mon+','+yea;forth = "26th,"+mon+','+yea;break;case "Wednesday":secnd = "11th,"+mon+','+yea;forth = "25th,"+mon+','+yea;
break;case "Thursday":secnd = "10th,"+mon+','+yea;forth = "24th,"+mon+','+yea;break;case "Friday":secnd = "9th,"+mon+','+yea;forth = "23rd,"+mon+','+yea;break;case "Saturday":secnd = "8th,"+mon+','+yea;forth = "22nd,"+mon+','+yea;break;default:break; }
document.getElementById('secsat').value = secnd;
document.getElementById('foursat').value = forth;
}
function ctck()
{var sds = document.getElementById("dum");if(sds == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}var sdss = document.getElementById("dumdiv");if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
}
document.onload ="ctck()";
</script>

<!-- Script by hscripts.com -->





HTML Code

<!-- Script by hscripts.com -->

<form name="saturday">
<table align="center" width=40% style='font-family: Monaco, Verdana, Sans-serif; font-size: 12px;background-color: #f9f9f9;border: 1px solid #D0D0D0;color: #002166; '><tr>
<td>Select Month:</td><td><select id="month">
<option>January</option>
<option>February</option>
<option> March</option>
<option> April</option>
<option> May</option>
<option> June </option>
<option>July </option>
<option>August </option>
<option>September </option>
<option>October</option>
<option> November</option>
<option>December</option>
</td></select></tr>
<tr><td>Select Year:</td><td><select id="year">
<option>2009</option>
<option>2010</option>
<option> 2011</option>
<option> 2012</option>
<option> 2013</option>
<option> 2014 </option>
<option>2015 </option>
<option>2016 </option>
<option>2017 </option>
<option>2019</option>
<option> 2020</option>
</td></select></tr>
<tr><td align=center>             
<input type="button" value="Submit" id="submit" onClick="calculate()" ></td></tr><br><br>
<tr><td>Second Saturday:</td><td><input type="text" name="secsat" id="secsat"></td></tr>
<tr><td>Fourth Saturday:</td><td><input type="text" name="foursat" id="foursat"></td></tr>
</table>
</form>
<div style="font-size: 10px;color: #dadada;" id="dumdiv" align=center>
<a href="https://www.hscripts.com" id="dum" style="text-decoration:none;color: #dadada;">©h</a></div><!-- Script by hscripts.com -->

  • Release Date - 19-02-2011
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Copy and paste the javascript code into your file.
  • Execute the code.
  • Select month and year using drop down list and then click "submit" button.
  • Simple and Easy to find second and fourth saturday in a month.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question