Bootstrap+daterangepicker日期范围选择器

来源:https://www.sucaihuo.com/js/425.html 2015-08-21 01:05浏览(3172) 收藏

daterangepicker日期范围选择器可以弹出两个日历选择日期,时间,并且可自定义日期范围选择,点击Apply即可确定选择。再次点击日期输入框,会发现刚选中的两个日期被范围化了。
Bootstrap+daterangepicker日期范围选择器
分类:日期时间 > 日期控件 难易:中级
查看演示 下载资源 下载积分: 20 积分

HTML

首先在.demo放置日期输入框#config-demo和日期图标i.glyphicon-calendar

<div class="col-md-4 col-md-offset-2 demo">
    <input type="text" id="config-demo" class="form-control">
    <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
</div>

jQuery

updateConfig();
function updateConfig() {
    var options = {};
    $('#config-demo').daterangepicker(options, function(start, end, label) {
        //console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')');
    });
}
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2