Format html dates

0

You will see in the forms when I use the input type field, whenever the browser changes the format to months, days, years ... but I need that regardless of the browser it is maintained in days, months, years

<form action="" id="form">
        <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
            <div class="form-group">
            <label for="male">Monto a ingresar</label><br>
            <input type="text" name="inversion" placeholder="$10.000.000" class="form-control" id="separadorMiles" required><br>
            <label for="startDate">Fecha Inicio</label><br>
            <input type="date" name="date" id="dateIni"  value="2018-04-10" min="2016-04-27" max="2018-05-09" class="form-control" ><br>
            <label for="endDate">Fecha Terminación</label><br>
            <input type="date" name="date" id="dateFin"  value="2018-05-10" min="2016-04-28" max="2018-05-10"  class="form-control" ><br>
            <br>
            <button type="button" onclick="getData()" class="btn btn-default">Consultar</button>
            <script type="text/javascript" src="js/app-60.js?110"></script>
            </div>
        </div>     
</form> 
    
asked by Elliot Frank 16.05.2018 в 00:07
source

1 answer

0

You must use a pattern attribute to format the date, but it will only be applied when you do the post of the data.

pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}"

More info by clicking here in the part that says Handling compatibility between browsers

    
answered by 16.05.2018 в 00:30