Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I display 3 digits for days ('ddd')? #33

Open
osumac24 opened this issue Jan 28, 2015 · 9 comments
Open

How do I display 3 digits for days ('ddd')? #33

osumac24 opened this issue Jan 28, 2015 · 9 comments

Comments

@osumac24
Copy link

I'd like to countdown from a date that is more than 99 days away.

@chyenw
Copy link

chyenw commented Mar 20, 2015

I need this too. Any fix for this?

@skowronek
Copy link

I forked this project with the change to include 3 digit days.

@chyenw
Copy link

chyenw commented Mar 20, 2015

Interesting! i tried using it but i can't seem to get the countdown timer to work well.
I want it do count down to 20th March 2016.

  $(function(){
    $(".digits").countdown({
      image: "img/digits.png",
      format: "dd:hh:mm:ss",
      endTime: new Date(2016,3,20)
    });

but the days seems wrong... any help?

@skowronek
Copy link

Try this:

$(function(){
    $(".digits").countdown({
      image: "img/digits.png",
      format: "ddd:hh:mm:ss",
      endTime: new Date(2016,3,20)
    });

The API is pretty explicit to the format parameter. I modified is to allow unlimited dddddd's, so you could theoretically show all days.

@osumac24
Copy link
Author

I was unable to find a solution so I ended up using/modifying flipclock.js

@jadeye
Copy link

jadeye commented Jun 29, 2016

I read everything I could find here but still I only get 2 digits for days. Here's my code:

jQuery(document).ready(function($) {
    $('#counter').countdown({ 
        image: "wp-content/themes/sometheme/img/digits.png", 
        format: "ddd:hh:mm:ss", 
        endTime: new Date('12/29/16 23:59:59') 
    });
});

@zilahir
Copy link

zilahir commented Oct 16, 2016

is there a way to show only days and hrs? seems like ddd:hh couting down from hours as seconds... any suggestions?

@luisaoxxy
Copy link

For 3 digits, try to modify this lines
148 --> if( format.indexOf('ddd') == 0 ) {
182 --> return format.replace(/(ddd|hh|mm|ss)/g, function($0, form) {
188 --> var pad = function(x){if(x > 99){return x}else{return (1e15+""+x).slice(-2)}

For me works

@sakara27
Copy link

sakara27 commented Feb 27, 2019

I'd like to countdown from a date that is more than 99 hours. Is there a way to show 3 digits hrs?

clock = $('.clock').FlipClock({
clockFace: 'HourlyCounter',
autoStart: false,
language: 'es',
callbacks: {
stop: function() {
$('.message').html('The clock has stopped!')
}
}
});
but when hours is >99 seems wrong... any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants