Good morning, I am making a form in which you have to fill in several fields, including a calendar to choose a date. For this I use DatetimePicker. I get the calendar to work, but I can not change the language (I have tried changing the order of calls from the necessary libraries to see if it is a problem but I still do). I attach my code:
$(document).ready(function(){
var date_input=$('input[name="date"]'); //our date input has the name "date"
var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
date_input.datepicker({
format: 'mm/dd/yyyy',
container: container,
todayHighlight: true,
autoclose: true,
locale: 'es'
})
})
<head>
<title></title>
<!-- AÑADIDO -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src='js_propio/cookies.js'></script>
<script src='js_propio/funciones.js'></script>
<script src='js_propio/eventos.js'></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="assets/css/vendor.css">
<link rel="stylesheet" type="text/css" href="assets/css/flat-admin.css">
<!-- Theme -->
<link rel="stylesheet" type="text/css" href="assets/css/theme/blue-sky.css">
<link rel="stylesheet" type="text/css" href="assets/css/theme/blue.css">
<link rel="stylesheet" type="text/css" href="assets/css/theme/red.css">
<link rel="stylesheet" type="text/css" href="assets/css/theme/yellow.css">
</head>
<body>
<div class="row" id="datosCita">
<div class="col-md-12">
<div class="card">
<div class="card-header">
Rellene los siguientes datos
</div>
<div class="card-body">
<div class="row">
<div id="datos">
<select class="select2" id="listEspec">
<option value="0">-- Seleccione una especialidad --</option>
</select>
</div>
<div id="profesionales">
<select class="select2" id="listProf">
<option value="0">-- Seleccione un profesional --</option>
</select>
</div>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input class="form-control" id="date" name="date" placeholder="DD/MM/YYYY" type="text"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-footer">
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<button type="submit" class="btn btn-primary">Confirmar cita</button>
<button type="button" class="btn btn-default">Cancelar</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="assets/js/vendor.js"></script>
<script type="text/javascript" src="assets/js/app.js"></script>
<script src='js_propio/cookies.js'></script>
<!-- Include Date Range Picker -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/bootstrap-datetimepicker.es.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>
I would appreciate any help you could give me. Thank you very much.