madumoulin / jquery-countdown

Automatically exported from code.google.com/p/jquery-countdown
0 stars 0 forks source link

Countdown to a given date in the future #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I would really like to see this feature, similar to the following jQuery plugin:

http://keith-wood.name/countdownBasics.html

Original issue reported on code.google.com by hristo.o...@gmail.com on 18 Feb 2011 at 7:10

GoogleCodeExporter commented 9 years ago
// function for converting numbers to two digits format
function twoDigits(number) {return (number < 10 ? '0' : '') + number};

        var goal = "Mon Apr 18 2011 03:00:00 GMT+0200";
        goal = new Date(goal);
        var now = new Date();
        var count = new Date(goal.getTime() - now.getTime());
// some time correction
        var day = count.getDate() - 1;
        var hour = count.getHours() - 1; 
// if you're using different format you have to change this line:
        var format = twoDigits(day) + ":" + twoDigits(hour) + ":" + twoDigits(count.getMinutes()) + ":" + twoDigits(count.getSeconds());

        $('#counter').countdown({
          image: 'img/digits.png',
          startTime: format
        });

Original comment by Stanislav.Hruska on 18 Apr 2011 at 12:53

GoogleCodeExporter commented 9 years ago
Does this work? How do I implement the given code?

Original comment by jakeleff...@gmail.com on 22 Jun 2011 at 2:29

GoogleCodeExporter commented 9 years ago
I've made a way with PHP to countdown to a given date. I've tried to contact 
the original developer, but see no way how to. 

Original comment by yani...@gmail.com on 22 Jun 2011 at 5:37

GoogleCodeExporter commented 9 years ago
Have now added a feature to allow a Date object to be used for startTime.

https://github.com/pfarmer/jquery-countdown

Original comment by pfar...@gmail.com on 22 Sep 2011 at 12:21

GoogleCodeExporter commented 9 years ago
hi everyone
i had used your  this example and its worrking fine but now i want  that its 
daily  starts counting from 12am and dialy end with 3 pm. how can i do that. 
i attached the complete file  that is m using on my local system
pls check it up..
advance  thanks.
i m newbi and this is my first comment. any mistake then sorry in advance.. 
helppppppppppppppppppppppp???

Original comment by hardeep....@gmail.com on 31 Aug 2012 at 1:52

Attachments: