I have a situation where I try to use the Trent Richardson jQuery datetimepicker extension so that users can select dates and times at a time.
But before that, I want to set the date and time so that the default date and time that will be set from the server is displayed in the datetimepicker input field. Then the user will click inside the input field to call the datetimepicker, after which the default date and time will appear on the datetimepicker. The user can then override them if necessary.
So far in my code I have:
<script type="text/javascript"> $(function(){ $('.example-container > pre').each(function(i){ eval($(this).text()); }); $('#example1').datetimepicker('setDate', (new Date(2010, 11, 20, 16, 03))); }); </script>
The correct date will be set, but not the time and hour and minute sliders. The time is also displayed as 00 03, not 16 03.
Can someone tell me what I'm doing wrong or not doing here so that the datetimepicker shows the correct default settings?
Other settings:
$('#example1').datetimepicker({ dateFormat: 'dd mm yy', timeFormat: 'hh mm', showMinute: false, showSecond: false, separator: ' ', });
thanks
source share