Need help with countdown script… TIM, halp! LOL

Home Page Forums Christmas Webmaster Need help with countdown script… TIM, halp! LOL

This topic contains 19 replies, has 0 voices, and was last updated by Profile photo of Jinglebelle Jinglebelle 3 years, 7 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #2113
    Profile photo of Jinglebelle
    Jinglebelle
    Member

    hey Tim, could you help me with something? Or actually, I need more than just “help”, I don’t understand at all… math makes my head hurt 🙁

    You had written a script that auto updates each year for Christmas… is there anyway to make it countdown to Halloween and auto update each year? I was looking at the page you gave me for reference, and when you said clear as mud, you were not kidding!! I’m lost. COMPLETELY x=6+y

    [HTML]
    today = new Date();
    thismon = today.getMonth();
    thisday = today.getDate();
    thisyr = today.getFullYear();
    if (thismon == 11 && thisday > 25)
    {
    thisyr = ++thisyr;
    BigDay = new Date(“December 25, “+thisyr);
    }
    else
    {
    BigDay = new Date(“December 25, “+thisyr);
    }
    msPerDay = 24 * 60 * 60 * 1000;
    timeLeft = (BigDay.getTime() – today.getTime());
    e_daysLeft = timeLeft / msPerDay;
    daysLeft = Math.floor(e_daysLeft);
    e_hrsLeft = (e_daysLeft – daysLeft) * 24;
    hrsLeft = Math.floor(e_hrsLeft);
    minsLeft = Math.floor((e_hrsLeft – hrsLeft) * 60);
    document.write(“” + daysLeft + ” days
    til Christmas!”);


    [/HTML]

    No, thisyr = ++thisyr means to increment the value in thisyr by one. In context of the script, when the date is between 12/26 and 12/31 the 1 is added to the year to get the correct year for next Christmas.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.