1
I am using this datepicker in my project, already this configured as you can see below the Dateformat in d/m/Y format, more like when I went to save in the bank it would convert to Y-m-d format, how could do it?
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<form action="#" method="post">
<input type="text" name="calendario" id="calendario"/>
<input type="submit" value="Enviar">
</form>
<script>
$(function() {
$( "#calendario" ).datepicker({
dateFormat: 'dd/mm/yy',
dayNames: ['Domingo','Segunda','Terça','Quarta','Quinta','Sexta','Sábado','Domingo'],
dayNamesMin: ['D','S','T','Q','Q','S','S','D'],
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb','Dom'],
monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez']
});
});
</script>
<?php
$anos = isset($_POST['calendario']) ? $_POST['calendario'] : '';
echo $anos;
?>