Skip to content

.timepicker altField gets date added #583

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

Closed
thomporter opened this issue May 1, 2013 · 4 comments
Closed

.timepicker altField gets date added #583

thomporter opened this issue May 1, 2013 · 4 comments

Comments

@thomporter
Copy link

I don't know if this is something I'm doing or a real issue, but here goes... And sorry if it's been posted elsewhere, I searched around a bit and couldn't find anything exactly the same.

I'm trying to use .timepicker() to display the time with am/pm but populate a hidden field with 24 hour format. As soon as I move the sliders on the time picker, the hidden field gets populated with today's date and the time I've chosen, not just the 24 hour time...

Here's my script:

    $(function(){
        $('#start_time_display').timepicker({
            timeFormat: "hh:mm tt",
            altFieldTimeOnly: false,
            altField: '#start_time',
            altFormat: '', // Have tried removing this, no luck
            altTimeFormat:'HH:mm:ss'
        })
    });
@trentrichardson
Copy link
Owner

There is an example of similar on the documentation, just reverse. altField section, 3rd example. Primary input gets 24hr, alt gets 12hr

http://trentrichardson.com/examples/timepicker/

@trentrichardson
Copy link
Owner

Sorry, I misread your issue, the problem is even though you are using just timepicker the date is also populated in the altField, is that correct?

@thomporter
Copy link
Author

Yes, that is correct.

@thomporter
Copy link
Author

You sir, are THE MAN! Works flawlessly! Love the plugin!

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

2 participants