• Nike free run 2 pink
  • Nike free 5.0 kids
  • Oakley sunglasses discount
  • CodeAve.com CodeAve.com - JavaScript - Misc
    ASP
    JavaScript
    ·Document Info
    ·Forms
    ·Images
    ·Miscellaneous
    ·Navigation
    ·Script Writers
    ·Contents
    ·What's New?
    CSS
    HTML
    Maps
    Links
    Mail List
    Search
    Sitemap


     

  • Retro 3 jordans
  • Jordan 13 retro
  • Nike free 5.0

  • Current Month Calendar
  • Air jordan 11 low
  • New Balance 996
  • Ray ban vintage sunglasses
  • The JavaScript calendar will display the current month and highlight the current date of the client computer. Since JavaScript draws all of its information from the client, the date reflected will be the client date not the date on your server. Parameters are set to define the number of days for the current month, the value of the first day of the month and a loop is created to display the first week with blanks in the weekdays for the previous month. A second loop fills in the remaining days of the month and inserts blanks in the weekdays for the beginning of the new month. A simple tautology is placed inside each loop to place the current date in bold type.
    View the Output
    Text View
    Print View
    Mail this Link
    Download the Code

    <html> 
    <title>CodeAve.com(Current Month Calendar)</title>
    <body bgcolor="#FFFFFF">
    <script Language="JavaScript">
    <!--
    // Set varible to the current date
    var right_now=new Date();

    // set variable to current month number (0-11)
    var month_num = right_now.getMonth()

    // set varible to the current day value (1-31)
    var thedate=right_now.getDate()

    // create an array for the month name
    var month_name = new Array (
    "January ",
    "February ",
    "March ",
    "April ",
    "May ",
    "June ",
    "July ",
    "August ",
    "September ",
    "October ",
    "November ",
    "December ");

    // Create a varible right_year with the current year
    var right_year=right_now.getYear();
    if (right_year < 2000) 
    right_year = right_year + 1900; 

    // create a varible to specify what the
    // last day for the current month is
    var theday = 0;
    if (
    month_num == 0 || 
    month_num == 2 || 
    month_num == 4 || 
    month_num == 6 || 
    month_num == 7 || 
    month_num == 9 || 
    month_num == 11)

    endofmonth=31;
    }
    if (
    month_num == 3 || 
    month_num == 5 || 
    month_num == 8 || 
    month_num == 10)

    endofmonth=30;
    }

    if (month_num == 1)

    // This will check for a leap year
    // If the year is evenly divisible by four
    // or in the case of a new century evenly divisible
    // by 400 then the end of the February month should be the 29th

    right_year_divided=right_year/4;
    right_year_divided_string= new String(right_year_divided);
    var is_decimal = right_year_divided_string.indexOf('.');
    if (is_decimal != -1)
    { endofmonth=28; }
    else
    { endofmonth=29; }

    right_year_string= new String(right_year);
    var the_century=new String(right_year_string.charAt(2)) 
    the_century= the_century + new String(right_year_string.charAt(3));
    if (the_century == "00")

    right_year_divided=right_year/400;
    right_year_divided_string= new String(right_year_divided);
    var is_decimal = right_year_divided_string.indexOf('.');
    if (is_decimal != -1)
    {endofmonth=28;}
    else
    {endofmonth=29;}
    }
    }

    // Start building the table
    document.write("<table border=1 align=center>");
    document.write("<caption><b>");

    // Place a caption with the month name and year
    document.write(month_name[month_num]);
    document.write(right_year );
    document.write("</b></caption>");

    // Write the table header row
    document.write("<tr><th>S</th><th>M</th><th>T</th><th>W</th>");
    document.write("<th>Th</th><th>F</th><th>Sa</th></tr><tr>");

    // Figure out which day of the week the 1st of the 
    // current month belongs to
    first_day = new Date(right_year,month_num,1)


    // Write the first row in the calendar with dates
    // Check which date of the month is the first to
    // fill it into the appropriate day of the week
    for (counter = 0; counter < 7; counter++)


    // Check the counter aganst the first day of the month value (0 - 6)

    if (counter >= first_day.getDay() ) 


    // Start counter for the calendar days
    theday=theday+1;

    // Check if the current day is in the first week if so, place bold text
    if (theday == thedate) 
    {document.write("<td><b>" + theday + "</b></td>");}
    else 
    // If it's not the current date output without bold text
    {document.write("<td>" + theday + "</td>");}

    else 
    // if there is no day yet output an empty cell
    {document.write("<td></td>"); }
    }

    // End row for the first week of the month
    document.write("</tr>"); 

    // Loop for the rest fo the weeks in the month 
    for (weeks = 0; weeks < 5; weeks++)

    document.write("<tr>"); 
    // loop for the days with the remaining weeks
    for (week = 0; week < 7; week++)
    {

    // counter for the day of the month
    theday=theday+1

    // if the couter = the current date display in bold 
    if (theday == thedate) 
    {document.write("<td><b>" + theday + "</b></td>");}
    else 


    // if the counter is higher then than the number of days
    // in the month then display a blank cell
    if (theday > endofmonth) 
    {document.write("<td></td>");}
    else 

    // If it's not the cureent day display the date wioth bold type
    {document.write("<td>" + theday + "</td>"); }
    }
    }
    document.write("</tr>");
    }
    document.write("</table>");
    //--></script>

    </body>
    </html>

     

     

     



    ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
    Server Variables | Response Objects | Random Events | Miscellaneous
    HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
    JavaScript: Document Info | Forms | Images | Navigation | Script Writers
    CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

    jordan 11 gamma Nike KD VI lebron 11 low