Error datepicker format JSP

0

Good this is my field to enter a holiday date, but the default format is like dd month, yyyy (27 September, 2018).

<div class="row">
 <div class="input-field col s4">
  <input type="date" class="datepicker" id="fechainivac" onchange="fnlimpiarvacaciones()" style="color: black;" value=" ">
    <label style="color: black;" for="Fecha Inicio Vacaciones">Fecha Inicio Vacaciones</label>
</div>

I used a javascript code to change the format but it still does not change anything:

$(function() {
  $('#fechainivac').datepicker({dateFormat:'dd-mm-yyyy'});
});

Some ideas to change the format, thank you in advance.

    
asked by Stalinn 27.09.2018 в 19:13
source

1 answer

0

Check that you have correctly written the format you are looking for . And change the inputs of type text. Let it be over with the HTML input date.

$(function() {
  $('#fechainivac').datepicker({dateFormat:'dd-MM-yy'});
  $('#fechainivac2').datepicker({dateFormat:'dd-mm-yy'});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<input type="text" class="datepicker" id="fechainivac"style="color: black;">
<input type="text" class="datepicker" id="fechainivac2"style="color: black;">
    
answered by 27.09.2018 в 20:09