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

After pausing getDuration() returns 0 #6

Closed
feimosi opened this issue Jul 19, 2015 · 3 comments
Closed

After pausing getDuration() returns 0 #6

feimosi opened this issue Jul 19, 2015 · 3 comments

Comments

@feimosi
Copy link

feimosi commented Jul 19, 2015

Hi, I think .getDuration() should always return the actual remaining time, whether it's running or being paused. By the way it'd be also great to see a corresponding method with time passed, not only duration left.

@husa
Copy link
Owner

husa commented Jul 20, 2015

Made appropriate changes to getDuration(). Now it'll return time when timer is started or paused, but 0 when it wasn't started or already stopped.
As of get elapsed time, feel free to add this via PR.

@husa husa closed this as completed Jul 20, 2015
@feimosi
Copy link
Author

feimosi commented Aug 4, 2015

Getting elapsed time turned out to be too tricky to implement with current code structere. Maybe another time.

@husa
Copy link
Owner

husa commented Aug 5, 2015

Actually, all you have to do is to save initial duration in start
smth like

duration && (this._.initialDuration = duration)

Then it'll be as easy as this._.initialDuration - this.getDuration()

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