I want to display only time from jquery datepicker. my current code is
$('#field-start_t_a').datetimepicker({
showDate:false,
showSecond: true,
timeFormat: 'hh:mm'
});
current output is
05/31/2013 00:12
required output is
00:12
DateTimePicker allows you to define the text representation of a date and time value to be displayed in the DateTimePicker control. The format specified is achieved by the dateTimeFormat property. Default value of this property is M/d/yyyy h: mm tt.
The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.
JavaScript Code: $( function() { var from = $( "#fromDate" ) . datepicker({ dateFormat: "yy-mm-dd", changeMonth: true }) . on( "change", function() { to. datepicker( "option", "minDate", getDate( this ) ); }), to = $( "#toDate" ).
try a code like this:
<script>
$('#time_input').datetimepicker({
datepicker:false,
format:'H:i'
});
</script>
Just set dateFormat to an empty string dateFormat: ''
$('#field-start_t_a').datetimepicker({
dateFormat: '',
timeFormat: 'hh:mm tt'
});
(this is a little strange that you only want to set time from the datetimepicker, because you can also do $('#field-start_t_a').timepicker();
and only the time options show)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With