»
Tiếng AnhTiếng PhápTiếng Việt

In - Tìm ngày lễ phục sinh - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Thời gian » Hợp lệ » Tìm ngày lễ phục sinh
URL: http://www.javascriptbank.com/calculator-for-easter-sunday.html

Tìm ngày lễ phục sinh © JavaScriptBank.comĐoạn mã sẽ yêu cầu người dùng nhập vào năm cần tìm ngày lễ Phục Sinh để hiệu ứng tìm chính xác ngày lễ này xảy ra vào tháng mấy.

Phiên bản đầy đủ: jsB@nk » Thời gian » Hợp lệ » Tìm ngày lễ phục sinh
URL: http://www.javascriptbank.com/calculator-for-easter-sunday.html



JavaScript
<script type="text/javascript"><!-- Begin// Created by: Matthew Ogden , ogden1972@earthlink.net | http://www.home.earthlink.net/~ogden1972/function d(){var a = document.form1.year.value;a=a*1if (a >= 2100) c=5;if (a < 2100) c=6;if (a > 2199) alert("you must enter a date between 1583 - 2199");if ( a<=1582) alert("you must enter a date between 1583 - 2199"); s = a/4var b = Math.floor( s ) ;sn=(b+a+c)/7var d = Math.floor( sn ) ;sundaynumber = (sn-d)*7m =(a*1)+1g = m/19var e = Math.floor( g ) ;var goldennumber = (g-e)*19;var sundaynumber= Math.round(sundaynumber) ;if(a>2199) sundaynumber=7;if(a<=1582) sundaynumber=7;var goldennumber= Math.round(goldennumber) ;var t1= "April 16April 17April 18April 19April 20April 21April 15" ;var t2= "April  9April 10April  4April  5April  6April  7April  8" ;var t3= "March 26March 27March 28March 29March 30March 24March 25" ;var t4= "April 16April 17April 18April 12April 13April 14April 15" ;var t5= "April  2April  3April  4April  5April  6April  7April  1";var t6= "April 23April 24April 25April 19April 20April 21April 22" ;var t7= "April  9April 10April 11April 12April 13April 14April 15" ;var t8= "April  2April  3April  4March 29March 30March 31April  1";var t9= "April 23April 17April 18April 19April 20April 21April 22" ;var t10= "April  9April 10April 11April 12April  6April  7April  8" ;var t11= "March 26March 27March 28March 29March 30March 31April  1" ;var t12= "April 16April 17April 18April 19April 20April 14April 15" ;var t13= "April  9April  3April  4April  5April  6April  7April  8" ;var t14= "March 26March 27March 28March 29March 23March 24March 25" ;var t15= "April 16April 17April 11April 12April 13April 14April 15" ;var t16= "April  2April  3April  4April  5April  6March 31April  1" ;var t17= "April 23April 24April 18April 19April 20April 21April 22" ;var t18= "April  9April 10April 11April 12April 13April 14April 8" ;var t19= "April  2April  3March 28March 29March 30March 31April  1" ;if (goldennumber == 1) chart=t1;if (goldennumber == 2) chart=t2;if (goldennumber == 3) chart=t3;if (goldennumber == 4) chart=t4;if (goldennumber == 5) chart=t5;if (goldennumber == 6) chart=t6;if (goldennumber == 7) chart=t7;if (goldennumber == 8) chart=t8;if (goldennumber == 9) chart=t9;if (goldennumber == 10) chart=t10;if (goldennumber == 11) chart=t11;if (goldennumber == 12) chart=t12;if (goldennumber == 13) chart=t13;if (goldennumber == 14) chart=t14;if (goldennumber == 15) chart=t15;if (goldennumber == 16) chart=t16;if (goldennumber == 17) chart=t17;if (goldennumber == 18) chart=t18;if (goldennumber == 19) chart=t19;if (sundaynumber==0)  document.form1.date.value = (chart.substring(0,8) )+", "+a;if (sundaynumber==6) document.form1.date.value = (chart.substring(8,16) )+", "+a;if (sundaynumber==5)  document.form1.date.value = (chart.substring(16,24) )+", "+a;if (sundaynumber==4)  document.form1.date.value = (chart.substring(24,32) )+", "+a;if (sundaynumber==3)  document.form1.date.value = (chart.substring(32,40) )+", "+a;if (sundaynumber==2)  document.form1.date.value = (chart.substring(40,48) )+", "+a;if (sundaynumber==1)  document.form1.date.value = (chart.substring(48,56) )+", "+a;if(sundaynumber==7) document.form1.date.value = "error";}// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form Name="form1">Year:  <input type="text" name="year" size="15">    Date:  <input type="text" name="date" readonly size="15"><br><br><input Type="button" value="Calculate" onclick="d()">    <input type="Reset" value="Clear">    <input Type="button" value="Print" onclick="window.d();print()"></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->