【bootstrap】使用支持bootstrap的时间插件daterangepicker
生活随笔
收集整理的這篇文章主要介紹了
【bootstrap】使用支持bootstrap的时间插件daterangepicker
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
其中的架包和代碼,具體可以去GitHub下查看:
https://github.com/AngelSXD/myagenorderdiscount
?
1.引入js和css
<link href="static/bootstrap/css/bootstrap.min.css" rel="stylesheet"><link rel="stylesheet" href="static/css/index/daterangepicker.css" /><link rel="stylesheet" href="static/css/index/custom.css"> <script src="static/bootstrap/js/jquery-1.11.0.min.js" type="text/javascript"></script> <script src="static/bootstrap/js/bootstrap.min.js"></script> <script src="static/js/index/custom.js"></script> <script src="static/js/index/daterangepicker.js"></script>2.頁面上有一個input框
<input type="text" class="form-control search-menu dateInput">3.js中賦予這個input時間插件即可
//時間搜索框--賦予時間插件$(".dateInput").daterangepicker({"showDropdowns": true,"showWeekNumbers": true,"showISOWeekNumbers": true,"autoApply": true}, function(start, end, label) {console.log("選定時間段: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");});?
?
效果如下:
?
總結
以上是生活随笔為你收集整理的【bootstrap】使用支持bootstrap的时间插件daterangepicker的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jenkins无法安装插件问题
- 下一篇: 萌宝出街,熊孩子逆袭小小“时髦精”