jquery日历
jQuery 日历插件推荐
1. jQuery UI Datepicker
jQuery UI 提供的官方日历插件,功能全面且易于集成。支持日期选择、范围限制、本地化等。

<!-- 引入 jQuery 和 jQuery UI -->
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!-- 使用 Datepicker -->
<input type="text" id="datepicker">
<script>
$(function() {
$("#datepicker").datepicker();
});
</script>
2. FullCalendar
适用于复杂日程管理的插件,支持拖拽事件、月/周/日视图切换,适合需要高级功能的场景。

<!-- 引入依赖 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fullcalendar@5.10.1/main.min.css">
<script src="https://cdn.jsdelivr.net/npm/fullcalendar@5.10.1/main.min.js"></script>
<!-- 初始化日历 -->
<div id="calendar"></div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth'
});
calendar.render();
});
</script>
3. Bootstrap Datepicker
基于 Bootstrap 的轻量级日历插件,适合 Bootstrap 项目,支持响应式设计。
<!-- 引入依赖 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
<!-- 使用示例 -->
<input type="text" class="form-control" id="bootstrap-datepicker">
<script>
$(document).ready(function(){
$('#bootstrap-datepicker').datepicker();
});
</script>
选择建议
- 简单需求:优先使用 jQuery UI Datepicker,集成方便。
- 复杂日程:FullCalendar 提供更丰富的交互功能。
- Bootstrap 项目:Bootstrap Datepicker 风格统一且轻量。
所有插件均支持自定义主题和事件回调,具体配置可参考官方文档。






