效果如图:
![](https://i-blog.csdnimg.cn/blog_migrate/1dc22293a140ec34082ce5070c6dafa8.png)
实现方法:
控制器对应的js页面:
{field: 'starttime', title:'开始配送日期',addclass:'datetimerange', formatter: Table.api.formatter.datetime,datetimeFormat:'YYYY-MM-DD', sortable: true,searchList: function (column) {
return Template('categorytpl2', {});
}
},
模板页面对应的js模板:
<script id="categorytpl2" type="text/html">
<input type="hidden" class="form-control operate" name="starttime-operate" data-name="starttime" value="BETWEEN" readonly="">
<div class="row">
<div class="col-xs-12">
<div class="form-inline row">
<div class="col-xs-14 col-sm-6">
<input type="text" style="width:90px" data-rule="required" class="form-control datetimepicker" name="starttime" id="s-s-time" value="" placeholder="开始日期" data-date-format="YYYY-MM-DD 00:00:00" data-use-current="true">
<span>至</span>
<input type="text" style="width:90px" data-rule="required" class="form-control datetimepicker" name="starttime" id="s-e-time" value="" placeholder="结束日期" data-date-format="YYYY-MM-DD 23:59:59" data-use-current="true">
</div>
</div>
</div>
</div>
</script>