Home > Back-end >  how to include time in bootstrap-datepicker
how to include time in bootstrap-datepicker

Time:02-03

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  data-date-format="mm/dd/yyyy"> 

$('.datepicker').datepicker({
    format: 'mm/dd/yyyy',
    startDate: '-3d'
});

CodePudding user response:

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  data-date-format="m/d/Y G:iK" data-enable-time="true">

  •  Tags:  
  • Related