Hello, How do I show the date generated in the Brazilian format? I searched here and on the internet but could not execute as I need.
See:
$(document).ready(function () {
$("#button").click(function() {
var dias = 2;
var dataAtual = new Date();
var previsao = dataAtual.setDate(dataAtual.getDate() + dias);
$("#dPrev").val(dataAtual);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script><inputname="dPrev" type="text" class="form-control" id="dPrev" value="" placeholder="DD/MM/YYYY" required >
<button type="submit" id="button" name="button" class="btn btn-success pull-right"></i> Salvar</button>
It takes the current date, adds days and needs to display in the field as DD / MM / YYYY
Thanks for any help.