I need to show the default date in all the fields, but when adding the option of the minDate: new Date () plugins the dates in the fields are not shown, but if the value is internally in the field.
Example:
Code:
$(function(){
$('.date').each(function() {
$(this).datetimepicker({
minDate: new Date(),
format: 'YYYY-MM-DD',
ignoreReadonly: true,
useCurrent: false
});
});
});
<link href="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/build/css/bootstrap-datetimepicker.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
<script src="https://cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/a549aa8780dbda16f6cff545aeabc3d71073911e/src/js/bootstrap-datetimepicker.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Example</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<input type="text" name="date" class="form-control date" readonly value="2017-01-01" placeholder="Your month">
</div>
<div class="form-group">
<input type="text" name="date" class="form-control date" readonly value="2017-01-01" placeholder="Your month">
</div>
<div class="form-group">
<input type="text" name="date" class="form-control date" readonly value="2017-01-01" placeholder="Your month">
</div>
<div class="form-group">
<input type="text" name="date" class="form-control date" readonly value="2017-01-01" placeholder="Your month">
</div>
</div>
</div>
</div>
</body>
</html>