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

selectTime does not fire when selecting same time if using useSelect #427

Closed
dlsso opened this issue Aug 31, 2015 · 3 comments
Closed

selectTime does not fire when selecting same time if using useSelect #427

dlsso opened this issue Aug 31, 2015 · 3 comments

Comments

@dlsso
Copy link

dlsso commented Aug 31, 2015

Normally selectTime fires even if you select the time that was previously selected. If using useSelect it only fires on change. I assume this is because it is difficult to detect this event on a select box (see http://stackoverflow.com/questions/647282/is-there-an-onselect-event-or-equivalent-for-html-select/12404521#comment16598702_7858323) but it would be really nice to have consistent behavior there or at least note it in the documentation.

Example:
http://jsfiddle.net/jLfv77ox/1/

Update:
I also noticed that when using useSelect hideTimepicker seems to fire on blur instead of on hide.

@jonthornton
Copy link
Owner

The two are related. Like you pointed out, it's difficult to detect an onSelect equivalent for the native select element. In order to reliably fire the 'hideTimepicker' event it has to be attached to blur.

I'll add a note to the documentation. Thanks for asking.

@ursheth
Copy link

ursheth commented May 29, 2018

Hello
I use this time picker. It is really nice.
I need some help like I use seconds as well.
I want time picker like
00:00:00
00:00:10
00:00:20
means I want 10-second interval I use steps in time picker but what function I need to write can you please help me.
timepicker

please help me,
Thank you

@deepchrish
Copy link

deepchrish commented Oct 31, 2020

I used this script like this to add a 10-minute interval

 $(function () {
    $('.addtime').timepicker();
    // Comment out the following line and you will see that normally the event will fire even if selecting the same time again
    $('.addtime').timepicker('option', {
      useSelect: true,
      step: 10,
    });
  });

https://prnt.sc/vanl26

For more options or customization read this documentation
https://cdn.jsdelivr.net/npm/timepicker@1.13.15/README.md

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

4 participants