实例代码
to
script> script> script>
// 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
});script> script> script>
// 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');
});
下载本文