Results 1 to 1 of 1

Thread: Playing around with the easter month on your calendar.

  1. #1
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Thanked 4 Times in 4 Posts

    Default Playing around with the easter month on your calendar.

    This a bit skeptic if you don't know how it works for you! Here's how we handle it... The so called easter month problem.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
      <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <title>Prototyping</title>
      </head>
    <body>
     <script type="text/javascript">
    <!--Hiding
      var today = new Date();
      var month = today.getMonth();
      var date = today.getDate();
      var year = today.getFullYear();
      var a = year % 19;
      var b = Math.floor(year/100);
      var c = year % 100;
      var d = Math.floor(b/4);
      var e = b % 4;
      var f = Math.floor((b+8) / 25);
      var g = Math.floor((b-f+1) / 3); 
      var h = (19*a + b - d - g + 15) % 30;
      var i = Math.floor(c/4);
      var j = c % 4;
      var k = (32 + 2*e + 2*i - h - j) % 7;
      var m = Math.floor((a + 11*h + 22*k) / 451);
      var easterMonth = Math.floor((h + k -7*m + 114) / 31);
      var easterDate = ((h + k - 7*m +114) % 31) + 1;
    easterMonth = easterMonth-1;
    
    if (( month == easterMonth ) && ( date == easterDate )); 
    document.write('Easter Sunday');
    // Done Hiding -->
    </script>
    </body>
    </html>
    Tell me if find any problem with this code... Tnx
    Last edited by ddadmin; 07-25-2008 at 09:49 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •