Reputation: 3296
I just started using the FlipClock js using this:
var clock;
$(document).ready(function() {
clock = $('.clock').FlipClock(3600 * 24 * 3, {
clockFace: 'DailyCounter',
countdown: true,
autostart: true
});
});
The clock does display,but the timer is not working.
ie: The clock timer doesn't flip.
I tried replacing the clockFace to "HourlyCounter" and it worked perfectly. But doesn't work on "DailyCounter".
Is this a bug or is it just me?
Upvotes: 1
Views: 314
Reputation: 60
have you tried using Cookies? use clock.getTime() to get the last date time data before user leave your page.
Upvotes: 0
Reputation: 91
A bad if condition inside flipclock.js is the culprit at around line 482 inside the method
flip: function(time, doNotAddPlayClass)
Please change the following code snipet
if (!t.factory.time.time instanceof Date) {
if(!t.factory.countdown) {
t.factory.time.time++;
}
else {
if(t.factory.time.time <= 0) {
t.factory.stop();
}
t.factory.time.time--;
}
}
to
if (!(t.factory.time.time instanceof Date)) { //-- would satisfy condition in this case.
if(!t.factory.countdown) {
t.factory.time.time++;
}
else {
if(t.factory.time.time <= 0) {
t.factory.stop();
}
t.factory.time.time--;
}
}
Upvotes: 1