绑定
$("#iptStartDate" ).datepicker({
showButtonPanel:true,
showOn: "button",
buttonImage: "common/easyUI/themes/black/images/datebox_arrow.png",
buttonImageOnly: true
});
绑定中设置了按钮图片,并且只有点击按钮图片之后才会弹出时间控件,如果要设置输入框和按钮图片保持高度和宽度,使用如下代码:
.divStartTime .divStartDate input[type="text"]
{
float: left;
width: 140px;
height: 16px;
border : 0;
cursor: pointer;
padding-left: 2px;
margin-top: -1px;
}
操作
1、设置时间
$('#iptStartDate').datepicker('setDate', new Date());
2、获取时间
var strStartDate = $('#iptStartDate').datepicker({ dateFormat: 'yy-mm-dd' }).val();
注好运