企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 日期区间 daterangepicker 参考文档: [http://www.daterangepicker.com/](http://www.daterangepicker.com/) ![](https://box.kancloud.cn/2016-06-29_57738491cea39.png) ##使用 ``` <input type="text" value="2015/11/11 至 2015/12/20" id="daterangepicker" style="margin:10px;" size="200"> <script> require(['util'], function (util) { util.daterangepicker({ element:'#daterangepicker',//点击元素 options:{ timePicker: true, timePickerIncrement: 30, "locale": { "format": "YYYY/MM/DD h:mm",//YYYY/MM/DD H:m "separator": " 至 ", "applyLabel": "确定", "cancelLabel": "取消", "fromLabel": "From", "daysOfWeek": [ "日", "一", "二", "三", "四", "五", "六" ], "monthNames": [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ], "firstDay": 0 } },//选项请参考官网 callback:function (start, end, label) { str = start.format('YYYY-MM-DD') + ' 至 ' + end.format('YYYY-MM-DD'); $('#daterangepicker').val(str); } }); }); </script> ```