简体   繁体   中英

how to include time in bootstrap-datepicker

is it possible to include time to bootstrap-datepicker because I could not find anything to include time, and if it is not possible what Is the attentive to bootstrap-datepicker that could work with bootstrap 5

here is my code

<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

There are lots of alternatives. But I will recommend flatpickr . It's javascript/CSS framework independent.

 // 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/YG:iK" data-enable-time="true">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM