Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8421501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:10:13+00:00 2026-06-10T03:10:13+00:00

I have a countdown at my site, i want it to countdown to next

  • 0

I have a countdown at my site, i want it to countdown to next Friday, and when the friday is over, i want it to automatically countdown to the next Friday.. and just repeat that..

I have this script, but cant seem to get it to work, can some one help me here ?

Thanks in advance

$(function(){

var note = $('#note'),
    ts = new Date(5), //Setting the date here
    newYear = true;

if((new Date()) > ts){
    ts = (new Date()).getTime() + 10*24*60*60*1000;
    newYear = false;
}

$('#countdown').countdown({
    timestamp   : ts,
    callback    : function(days, hours, minutes, seconds){

        var message = "";

        message += days + " day" + ( days==1 ? '':'s' ) + ", ";
        message += hours + " hour" + ( hours==1 ? '':'s' ) + ", ";
        message += minutes + " minute" + ( minutes==1 ? '':'s' ) + " and ";
        message += seconds + " second" + ( seconds==1 ? '':'s' ) + " <br />";

        if(newYear){
            message += "left until the new year!";
        }
        else {
            message += "left to 10 days from now!";
        }

        note.html(message);
    }
});

});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:10:15+00:00Added an answer on June 10, 2026 at 3:10 am

    Use the getDay() method that exist on the Date object which will return the number of the day 0 = Sunday, 1 = Monday, 5 = Friday.
    Determine which day it is today and how many days it is until the next day number 5.
    Then ts = (new Date()).getTime() + 60*60*24*daysUntilFriday*1000;
    After this you also want to use the method setHours(), setMinutes(), and Seconds to 0 so that you get the exact time until Friday starts.

    EDIT!
    Sorry when you are done with your ts variable you want to use setTime(ts) so that you get a new Date object with the next Fridays date. And then you start setting hours, minutes and seconds to zero and then getTime() again so that your ts is the correct format for your countdown method.

    Good luck!

    Regards
    Tobias

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a this working countdown timer in jQuery but for now I'm just
I have got a piece of code, that should countdown some number (in this
I have this countdown script wrapped as an object located in a separate file
I have a countdown timer that onFinished I want to have the screen change
I have a function that displays a countdown next to a text field for
In my android project, I have a countdown that randomizes a boolean for an
I have the following script: Timer=0; function countdown(auctionid){ var auctions; var divs; Timer=Timer+1; if((Timer%10==0)||(Timer==1)){
I have my timer code set up, and it's all kosher, but I want
I have an app that runs a countdown timer and brings up an alertbox
I have been trying for half a day to loop this countdown function. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.