1

I'm using the datetimepicker from this site: http://trentrichardson.com/examples/timepicker/

It works nice, but not perfect. I need to make the "Today" button set the field to "2010-11-21 23:24" instead of "2010-11-21". Important is, that when I don't use the timepicker (because it's the jQuery UI datepicker extension), it just gives "2010-11-21". The Problem is, i'm not that into javascript. Could anybody help me with this one?

The code can be found here:

http://trentrichardson.com/examples/timepicker/js/jquery-ui-timepicker-addon.js

1
  • Crikey. I hit up the post as I'm after a time selector - not sure that the one featured actually makes things any easier than a drop-down or plain text field! Commented Nov 28, 2010 at 16:37

1 Answer 1

3

Use a custom format

$('#selector').datetimepicker({
    timeFormat: 'hh:mm'
});

Internally the plugin will already set the date & time to the current date & time. You dont have to write any code for this. It's just a matter of formatting the result...

Sign up to request clarification or add additional context in comments.

1 Comment

jQuery('.datetime').datetimepicker({showSecond: false,timeFormat: 'hh:mm',dateFormat: 'dd/mm/yy'}); Does not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.