Recently, I delved into the world of JS and attempted to implement a datetimepicker in my web-demo. Everything was running smoothly with bootstrap 3.3.7, but as soon as I upgraded to version 5, the calendar disappeared.
Below is the minimal working html code:
<!-- this works perfectly fine -->
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
<!-- this doesn't work! -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c3a1acacb7b0b7b1a2b883f6edf2edf0">[email protected]</a>/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/3.1.3/css/bootstrap-datetimepicker.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>
<div class='input-group date' id='datetimepicker1'>
<input type='text' class="form-control"/>
<span class="input-group-addon\">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
<script>
$(".date").datetimepicker({locale: "ru"});
</script>
I am reliant on
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="84e6ebebf0f7f0f6e5f4c4b1aab5aab7">[email protected]</a>
for the project and changing it just for one datetimepicker is not an option for me. Despite trying multiple approaches, none seem to be working. Any suggestions on how to make it functional?
According to ,
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js
is not compatible with Bootstrap 5 and is meant for Bootstrap 3.
Which version should I use instead? (and how can I determine that?)
It is worth noting that I require the {locale: "ru"}
parameter, which I believe is unavailable in Bootstrap 3.