Mr *_*gan 5 jquery jsp datetimepicker
我遇到一种情况,我试图使用Trent Richardson的datetimepicker JQuery扩展名让用户一次选择日期和时间。
但是在此之前,我想设置日期和时间,以便datetimepicker的输入框显示可以从服务器设置的默认日期和时间。然后,用户将在输入框中单击以调用datetimepicker,然后默认的日期和时间将出现在datetimepicker上。然后,用户可以在必要时覆盖它们。
到目前为止,在我的代码中,我有:
<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>
Run Code Online (Sandbox Code Playgroud)
它将正确设置日期,但不能正确设置时间,小时和分钟滑块。时间也显示为00 03,而不是16 03。
谁能告诉我我在做什么或不做什么,以便datetimepicker显示正确的默认设置?
其他设置是:
$('#example1').datetimepicker({
dateFormat: 'dd mm yy',
timeFormat: 'hh mm',
showMinute: false,
showSecond: false,
separator: ' ',
});
Run Code Online (Sandbox Code Playgroud)
谢谢
| 归档时间: |
|
| 查看次数: |
29277 次 |
| 最近记录: |