您好,欢迎来到海亿美食网。
搜索
您的当前位置:首页jquery.datepair日期时分秒选择器

jquery.datepair日期时分秒选择器

来源:海亿美食网


jquery.datepair是一个轻量级的jQuery插件,智能选择日期和时间范围,灵感来自于谷歌日历。Datepair将保持开始和结束日期/时间同步,并可以根据用户的操作设置默认值。该插件不提供任何UI小部件; 它预先配置工作的jquery-timepicker和引导DatePicker的,但你可以使用它与任何日期选择器或timepicker。

实例代码

to

// HTML not shown for brevity

$('#timeOnlyExample .time').timepicker({
 'showDuration': true,
 'timeFormat': 'g:ia'
});

$('#timeOnlyExample').datepair();

$('#dateOnlyExample .date').datepicker({
 'format': 'yyyy-m-d',
 'autoclose': true
});

$('#dateOnlyExample').datepair();
// HTML not shown for brevity

$('#defaultDeltaExample').datepair({
 'defaultDateDelta': 1, // days
 'defaultTimeDelta': 7200000 // milliseconds
});
// HTML not shown for brevity

// initialize input widgets first
$('#eventsExample .time').timepicker({
 'showDuration': true,
 'timeFormat': 'g:ia'
});

$('#eventsExample .date').datepicker({
 'format': 'm/d/yyyy',
 'autoclose': true
});

$('#eventsExample').datepair().on('rangeSelected', function(){
 $('#eventsExampleStatus').text('Valid range selected');
}).on('rangeIncomplete', function(){
 $('#eventsExampleStatus').text('Incomplete range');
}).on('rangeError', function(){
 $('#eventsExampleStatus').text('Invalid range');
});

Copyright © 2019- hyl365.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务