Hello, this is a fantastic library, but I am having trouble changing the clockface to 'MinuteCounter' using the setOption command.
My relevant code:
$(document).ready(function() {
clock = $('.clock').FlipClock(100, {
clockFace: 'HourCounter',
countdown: true
});
clock.setTime(timesdatanext); //variable set elsewhere
setInterval(function() {
if (getTimes().next >= 39600 && getTimes().next <= 43200) //conditional based on variable set elsewhere
{
$("#update").html("The update is happening right now and will continue for about:");
$("#update2").html("And the next update will start in:");
clock.setOption('clockFace', 'MinuteCounter');
clock2.setOption('clockFace', 'MinuteCounter');//second clock, not created in this excerpt
clock.setTime(getTimes().next - 39600);
clock2.setTime(getTimes().next);
}
// else statement below not included
// clock.setOption('clockFace', 'MinuteCounter') does not work?
What is the best way to accomplish this change to the MinuteCounter based on conditionals evaluated after the clockface has been created?
Hello, this is a fantastic library, but I am having trouble changing the clockface to 'MinuteCounter' using the setOption command.
My relevant code:
$(document).ready(function() { clock = $('.clock').FlipClock(100, { clockFace: 'HourCounter', countdown: true }); clock.setTime(timesdatanext); //variable set elsewhere setInterval(function() { if (getTimes().next >= 39600 && getTimes().next <= 43200) //conditional based on variable set elsewhere { $("#update").html("The update is happening right now and will continue for about:"); $("#update2").html("And the next update will start in:"); clock.setOption('clockFace', 'MinuteCounter'); clock2.setOption('clockFace', 'MinuteCounter');//second clock, not created in this excerpt clock.setTime(getTimes().next - 39600); clock2.setTime(getTimes().next);
} // else statement below not included
// clock.setOption('clockFace', 'MinuteCounter') does not work?
What is the best way to accomplish this change to the MinuteCounter based on conditionals evaluated after the clockface has been created?
Thank you! :)