hilios / jQuery.countdown

The Final Countdown plugin for jQuery
http://hilios.github.io/jQuery.countdown/
MIT License
2.31k stars 720 forks source link

Include time when counting left days #311

Open amswiatkowski opened 5 years ago

amswiatkowski commented 5 years ago

Hello, I have a problem with this plugin, it's counting days only considering the full days (from 23:59 to 00:00), for example from date 01-01-2018 to 02-01-2018 is 24h, but from 01-01-2018 18:00 to 02-01-2018 there should be 6hours left and i get 24hours. I have a script like:

$( document ).ready(function() 
{
    $('[data-countdown]').each(function() 
    {
        var $this = $(this), finalDate = $(this).data('countdown');
        $this.countdown(finalDate, function(event) 
        {
            $this.html(event.strftime('%-D %!D:dzień,dni; %-H h %-M min %-S s'));
            $this.on('finish.countdown', function(event)
            {
                $this.html("-");
                $this.css('text-align','center');;
            });
        });

    });
});

And I'm Passing there dates created with format Y-m-d H:i:s but counter is working like it's not considering timestamps, time is counted to 00:00 not to hour set in my variable. Please help :)

Christian-Stahl commented 5 years ago

+1 - Would be nice to be able to count down to a specific hour, minute or even second