+ Reply to Thread
Results 1 to 8 of 8

Thread: Calendar Script

  1. #1
    Co-Administrator xXHalfSliceXx is an unknown quantity at this point xXHalfSliceXx's Avatar
    Join Date
    Oct 2006
    Location
    Hendersonville, NC
    Age
    26
    Posts
    1,807
    Blog Entries
    3

    Calendar Script

    Code:
    <script type="text/css">
     calendar = new Date();
     day = calendar.getDay();
     month = calendar.getMonth();
     date = calendar.getDate();
     year = calendar.getYear();
     if (year &lt; 1000)
     year+=1900
     cent = parseInt(year/100);
     g = year % 19;
     k = parseInt((cent - 17)/25);
     i = (cent - parseInt(cent/4) - parseInt((cent - k)/3) + 19*g + 15) % 30;
     i = i - parseInt(i/28)*(1 - parseInt(i/28)*parseInt(29/(i+1))*parseInt((21-g)/11));
     j = (year + parseInt(year/4) + i + 2 - cent + parseInt(cent/4)) % 7;
     l = i - j;
     emonth = 3 + parseInt((l + 40)/44);
     edate = l + 28 - 31*parseInt((emonth/4));
     emonth--;
     var dayname = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
     var monthname = 
     new Array ("January","February","March","April","May","June","July","August","September","October","November","December" );
     document.write("<font face=verdana,arial size=2>");
     document.write(dayname[day] + ", ");
     document.write(monthname[month] + " ");
     if (date< 10) document.write("0" + date + ", ");
             else document.write(date + ", ");
     document.write(year + "    <font color=FF0000>");
     // Easter
     if ((month == emonth) && (date == edate)) document.write("- Easter Sunday (Western)   ");
     // January
     if ((month == 0) && (date == 1)) document.write("- New Year's Day");
     if ((month == 0) && (day == 1) && (date > 14) && (date< 22)) document.write("- Martin Luther King's Birthday");
     // February
     if ((month == 1) && (date == 2)) document.write("- Groundhog Day");
     if ((month == 1) && (date== 12)) document.write("- Lincoln's Birthday");
     if((month == 1) && (date == 14)) document.write("- St. Valentine's Day");
     if ((month == 1) && (date == 22)) document.write("- Washington's Birthday");
     if ((month == 1) && (date == 24)) document.write("- Slice's Birthday");
     if ((month == 1) && (date == 29)) document.write("- Leap Day");
     // March
     if ((month == 2) && (date == 17)) document.write("- St. Patrick's Day");
     // April
     if ((month == 3) && (date == 1)) document.write("- April Fools' Day");
     if ((month == 3) && (date == 15) && (day != 0)) document.write("- Income Tax Day (USA),   ");
     if ((month == 3) && (date == 16) && (day == 1)) document.write("- Income Tax Day (USA) ");
     if ((month == 3) && (date == 22)) document.write("- Earth Day");
     if ((month == 3) && (day == 0) && (date > 0) && (date< 8)) document.write("- Daylight Savings Time Begins");
     // May
     if ((month == 4) && (day == 0) && (date > 7) && (date< 16)) document.write("- Mother's Day");
     if ((month == 4) && (day == 1) && (date > 24)) document.write("- Memorial Day");
     if ((month == 4) && (date == 8)) document.write("- Slice's Mom's Birthday");
     // June
     if ((month == 5) && (date == 6)) document.write("- D-Day (USA)");
     if ((month == 5) && (date == 14)) document.write("- FlagDay");
     if ((month == 5) && (date == 21)) document.write("- Summer Begins");
     if ((month == 5) && (day == 0) && (date > 15) && (date< 24)) document.write("- Father's Day");
     // July
     if ((month == 6) && (date == 4)) document.write("- Independence Day (USA)");
     // August
     // September
     if ((month == 8) && (day== 1)&& (date > 0) && (date< 8)) document.write("- Labor Day (USA)");
     // October
     if ((month == 9) && (day == 1) && (date > 7) && (date< 16)) document.write("- Columbus Day (USA)");
     if ((month == 9) && (date == 22)) document.write("- Slice's Dad's Birthday");
     if ((month == 9) && (day == 0) && (date > 24) && (date< 31)) document.write("- Daylight Savings Time Ends");
     if ((month == 9) && (day == 0) && (date == 31)) document.write("- Daylight Savings Time Ends<BR>");
     if ((month == 9) && (date == 31)) document.write("- Halloween");
     // November
     if ((month == 10) && (day == 4) && (date > 23) && (date< 30)) document.write("- Thanksgiving");
     if ((month == 10) && (date == 30) && (day == 4)) document.write("- Thanksgiving");
     // December
     if ((month == 11) && (date == 10)) document.write("- Human Rights Day");
     if ((month == 11) && (date == 21)) document.write("- Winter Begins");
     if ((month == 11) && (date == 24)) document.write("- Christmas Eve");
     if ((month == 11) && (date == 25)) document.write("- Christmas");
     if ((month == 11) && (date == 26)) document.write("- Boxing Day");
     if ((month == 11) && (date == 31)) document.write("- New Year's Eve");
     document.write("<br></font>");
    //-->
     </script>
    Error?


  2. #2
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    Re: Calendar Script

    I changed this part and it just echoed out today:
    Code:
    <script type="text/css">
     calendar = new Date();
     day = calendar.getDay();
     month = calendar.getMonth();
     date = calendar.getDate();
     year = calendar.getYear();
     if (year &lt; 1000)
    Code:
    <script type="text/javascript"> //css?
     calendar = new Date();
     day = calendar.getDay();
     month = calendar.getMonth();
     date = calendar.getDate();
     year = calendar.getYear();
     if (year < 1000) //&lt;?

  3. #3
    Co-Administrator xXHalfSliceXx is an unknown quantity at this point xXHalfSliceXx's Avatar
    Join Date
    Oct 2006
    Location
    Hendersonville, NC
    Age
    26
    Posts
    1,807
    Blog Entries
    3

    Re: Calendar Script

    Cool.

    It looks better now.

    TheSliceZone.com


  4. #4
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: Calendar Script

    That does look good. I love TSZ design.

  5. #5
    hkp
    hkp is offline
    Learning Programmer hkp is an unknown quantity at this point hkp's Avatar
    Join Date
    May 2009
    Posts
    37

    Re: Calendar Script

    on this link another calendar script is explained..

    CodeProject: A JavaScript Weekly Calendar. Free source code and programming help

    _____________
    Design a website

  6. #6
    hkp
    hkp is offline
    Learning Programmer hkp is an unknown quantity at this point hkp's Avatar
    Join Date
    May 2009
    Posts
    37

    Re: Calendar Script

    on this link another calendar script is explained..

    Pop-up Calendar - JavaScript Made Easy
    _____________
    Design a website

  7. #7
    Newbie ValueForMoney is an unknown quantity at this point
    Join Date
    May 2009
    Location
    Google search engine
    Posts
    19

    Re: Calendar Script

    Thank you for the link..will read the explanation.

  8. #8
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    Re: Calendar Script

    Very nice looking site. Looks great ^-^

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Need a small script
    By Xhris in forum Services for Buy/Sell/Trade
    Replies: 5
    Last Post: 03-01-2010, 01:15 PM
  2. I need help with an script
    By midnightrose2008 in forum PHP Forum
    Replies: 2
    Last Post: 11-11-2008, 04:38 PM
  3. Help with custom rank script.
    By djkee in forum PHP Forum
    Replies: 7
    Last Post: 10-17-2008, 06:47 AM
  4. PHP: New Calculator script
    By Brandon W in forum Classes and Code Snippets
    Replies: 28
    Last Post: 10-08-2008, 03:15 PM
  5. how update an old php script
    By midnightrose2008 in forum PHP Forum
    Replies: 1
    Last Post: 07-07-2008, 09:39 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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