I am using bootstrap date time picker in my web application, made in PHP/HTML5 and JavaScript. I am currently using one from here: http://tarruda.github.io/bootstrap-datetimepic
I know this is late, but the answer is simply removing "time" from the word, datetimepicker
to change it to datepicker
. You can format it with dateFormat
.
jQuery( "#datetimepicker4" ).datepicker({
dateFormat: "MM dd, yy",
});
your same code work's fine, just add some link reference
<!DOCTYPE HTML>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen"
href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
</head>
<body>
<div class="well">
<div id="datetimepicker4" class="input-append">
<input data-format="yyyy-MM-dd" type="text"></input>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"> </i>
</span>
</div>
</div>
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script type="text/javascript"
src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript"
src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.pt-BR.js">
</script>
<script type="text/javascript">
$(function () {
$('#datetimepicker4').datetimepicker({pickTime: false});
});
</script>
</body>
</html>
This allows to show time in input field but hides time picker button, which is second li element in accordion
.bootstrap-datetimepicker-widget .list-unstyled li:nth-child(2){
display: none;
}
$(function () {
$('#datetimepicker9').datetimepicker({
viewMode: 'years',
format: 'DD/MM/YYYY' /*Add this line to remove time format*/
});
});
For bootstrap 4 version this code working;
$('#payment-date-time-select').datetimepicker({
startView:2,
minView:2,
});
Disable time in boostrap datetime picker...
$(document).ready(function () {
$('.timepicker').datetimepicker({
format: "dd-mm-yy",
});
});
Disable date in boostrap datetime picker...
$(document).ready(function () {
$('.timepicker').datetimepicker({
format: "HH:mm A",
});
});