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

Countdown timer with negative remaining time #86

Open
naXa777 opened this issue Jan 16, 2019 · 1 comment
Open

Countdown timer with negative remaining time #86

naXa777 opened this issue Jan 16, 2019 · 1 comment

Comments

@naXa777
Copy link

naXa777 commented Jan 16, 2019

Try to initialize countdown with negative remaining time (i.e. seconds > duration):

let timeLimit = 10;
let timeElapsed = 15;
let $countdown = $("#countdown").timer({
        countdown: true,
        duration: timeLimit + 's',
        seconds: timeElapsed
    });

Expected result: -5 sec
Actual result: -1:0-5 min

Demo: https://jsfiddle.net/naXa/gmcbfd4w (v0.7.1) and https://jsfiddle.net/naXa/gmcbfd4w/9 (v0.9.0)

jquery-timer-bug

It would be nice to have an endless countdown which:

  1. doesn't stop when reached 0.
  2. looks nice with negative time values.
  3. can be initialized with negative duration.
@walmik
Copy link
Owner

walmik commented Jan 20, 2019

Thanks for submitting this issue.

By default maybe we can have the timer stop on encountering such a situation and we can bypass it by a property that says something like allowNegativeCountdown. Or We could implement it and set this to be true by default and have users explicitly set it to false if they dont want this behavior.

Either ways, this is a good to have feature.. Feel free to implement it and send a PR (assign it to yourself if you are interested).. if not I ll try to squeeze in some time to add this unless somebody else picks it up and assigns to themselves in the mean time.

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

No branches or pull requests

2 participants