如何在 bootstrap-datepicker 中包含时间
how to include time in bootstrap-datepicker
是否可以将时间包含在 bootstrap-datepicker 中,因为我找不到任何包含时间的东西,如果不可能,那么 bootstrap-datepicker 的关注点是什么? bootstrap 5
这是我的代码
<input class="datepicker" data-date-format="mm/dd/yyyy">
$('.datepicker').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d'
});
if it is not possible what Is the attentive to bootstrap-datepicker
that could work with bootstrap 5
有很多选择。但我会推荐flatpickr。它 javascript/CSS 独立于框架。
// without jquery
flatpickr('.datepicker', {
// put options here if your don't want to add them via data- attributes
});
// with jquery
// $('.datepicker').flatpickr({ /* options here */ });
<!-- flatpickr CSS and javascript -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<input class="form-control bg-white datepicker" data-date-format="m/d/Y G:iK" data-enable-time="true">
是否可以将时间包含在 bootstrap-datepicker 中,因为我找不到任何包含时间的东西,如果不可能,那么 bootstrap-datepicker 的关注点是什么? bootstrap 5
这是我的代码
<input class="datepicker" data-date-format="mm/dd/yyyy">
$('.datepicker').datepicker({
format: 'mm/dd/yyyy',
startDate: '-3d'
});
if it is not possible what Is the attentive to bootstrap-datepicker that could work with bootstrap 5
有很多选择。但我会推荐flatpickr。它 javascript/CSS 独立于框架。
// without jquery
flatpickr('.datepicker', {
// put options here if your don't want to add them via data- attributes
});
// with jquery
// $('.datepicker').flatpickr({ /* options here */ });
<!-- flatpickr CSS and javascript -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<input class="form-control bg-white datepicker" data-date-format="m/d/Y G:iK" data-enable-time="true">