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

Get %H %M %S #76

Closed
keshiabrown16 opened this issue Nov 19, 2016 · 4 comments
Closed

Get %H %M %S #76

keshiabrown16 opened this issue Nov 19, 2016 · 4 comments

Comments

@keshiabrown16
Copy link

Hi, great plugin :)

Is there anyway to display the time in h m s rather than just displaying total seconds elapsed when using $('#sampleid').data('seconds'); ?

@shantanuthatte
Copy link

Please see the format option in README

For format syntax, see Format Syntax

@keshiabrown16
Copy link
Author

keshiabrown16 commented Nov 19, 2016

Thanks for the speedy reply but i think you have misunderstood me. I have already set format when calling the timer eg:
$(".t_header_time").timer({
format: '%H:%M:%S'
});

but when getting the total time elapsed using data('seconds'), it only gives you seconds. I want the time elapsed to be h m s.

@shantanuthatte
Copy link

shantanuthatte commented Nov 19, 2016

As a quick solution, you can get the element's text.
In your case,

$(".t_header_time").text();

Or, create a hidden element, initialize the timer and then get its text.

@keshiabrown16
Copy link
Author

Woah. Mind was totally blank, silly me. Thank you!! Again, great plugin :)

@walmik walmik closed this as completed Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants