[英]jQuery Date and timepicker - doesn't seems to work
I try to implement a Time and a Datepicker. 我尝试实现一个时间和一个日期选择器。 If I do it this way: 如果我这样做:
<script>
$(function() {
/*date_obj = new Date();
date_obj_hours = date_obj.getHours();
date_obj_mins = date_obj.getMinutes();
date_obj_time = " '"+date_obj_hours+":"+date_obj_mins+"'";*/
$.datepicker.setDefaults( $.datepicker.regional[ "no" ] );
$( "#datepicker" ).datepicker({dateFormat: $.datepicker.W3C}); // + date_obj_time
<!--$('#datepicker').datetimepicker();-->
});
</script>
The Datepicker works, but if I do it this way: Datepicker有效,但是如果我这样操作:
<script>
$(function() {
/*date_obj = new Date();
date_obj_hours = date_obj.getHours();
date_obj_mins = date_obj.getMinutes();
date_obj_time = " '"+date_obj_hours+":"+date_obj_mins+"'";*/
<!--$.datepicker.setDefaults( $.datepicker.regional[ "no" ] );-->
<!--$( "#datepicker" ).datepicker({dateFormat: $.datepicker.W3C}); // +date_obj_time-->
$('#datepicker').datetimepicker();
});
</script>
Nothing shows up in the textfield, when I click it. 当我单击它时,文本字段中没有任何显示。 How can I do this? 我怎样才能做到这一点? Thanks 谢谢
For the record, I followed this: http://trentrichardson.com/examples/timepicker/ 为了记录,我遵循了这一点: http : //trentrichardson.com/examples/timepicker/
jQuery to php date time UI calendar
<link rel="stylesheet" media="all" type="text/css" href="css/ui-lightness/jquery-ui-1.8.16.custom.css" />
<link rel="stylesheet" media="all" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"></script>
<input type="text" name="example1" id="example1" value="" />
<input type="text" name="example1" id="example2" value="" />
<script>
$('#example1').datetimepicker();
$('#example2').datetimepicker();
</script>
You can get all css from jquery website 您可以从jquery网站获取所有CSS
And here is the sample zip file i have http://www.woofiles.com/dl-294002-m4UvKkLO-testdate.rar 这是我拥有http://www.woofiles.com/dl-294002-m4UvKkLO-testdate.rar的示例zip文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.