JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Javascript to Find Second and Fourth Saturday


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


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

Preview
Finding Second and Fourth Saturday
Select Month:
Select Year:
Second Saturday:
Fourth Saturday:
©h


Code
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="http://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 5 price

For customization of this script or any script development, contact us at support@hscripts.com


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


License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting