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
$('#datetimepicker').datetimepicker({
minView: 2,
pickTime: false,
language: 'pt-BR'
});
Please try if it works for you as well
Not as put off time and language at a time I put this and not work
$(function () {
$('#datetimepicker2').datetimepicker({
locale: 'es',
pickTime: false
});
});
Initialize your datetimepicker like this
For disable time
$(document).ready(function(){
$('#dp3').datetimepicker({
pickTime: false
});
});
For disable date
$(document).ready(function(){
$('#dp3').datetimepicker({
pickDate: false
});
});
To disable both date and time
$(document).ready(function(){
$("#dp3").datetimepicker('disable');
});
please refer following documentation if you have any doubt
http://eonasdan.github.io/bootstrap-datetimepicker/#options
In my case, the option I used was:
var from = $("input.datepicker").datetimepicker({
format:'Y-m-d',
timepicker:false # <- HERE
});
I'm using this plugin https://xdsoft.net/jqplugins/datetimepicker/
Here's the solution for you. It's very easy to just add code like this:
$('#datetimepicker4').datetimepicker({
pickTime: false
minview:2;(Please see here.)
});
Check the below snippet
<div class="container">
<div class="row">
<div class='col-sm-6'>
<div class="form-group">
<div class='input-group date' id='datetimepicker4'>
<input type='text' class="form-control" />
<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(function() {
// Bootstrap DateTimePicker v4
$('#datetimepicker4').datetimepicker({
format: 'DD/MM/YYYY'
});
});
</script>
</div>
You can refer http://eonasdan.github.io/bootstrap-datetimepicker/ for documentation and other functions in detail. This should work.
Use localized formats of moment.js:
L
for date onlyLT
for time onlyL LT
for date and timeSee other localized formats in the moment.js documentation (https://momentjs.com/docs/#/displaying/format/)