1
I put in my site in Asp.net the datepicker of this website and I want to receive the value as Date instead of String , so that it does not give problems with the date type of other countries.
/* Brazilian initialisation for the jQuery UI date picker plugin. */
/* Written by Leonildo Costa Silva ([email protected]). */
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "../widgets/datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
}( function( datepicker ) {
datepicker.regional[ "pt-BR" ] = {
closeText: "Fechar",
prevText: "<Anterior",
nextText: "Próximo>",
currentText: "Hoje",
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" ],
dayNames: [
"Domingo",
"Segunda-feira",
"Terça-feira",
"Quarta-feira",
"Quinta-feira",
"Sexta-feira",
"Sábado"
],
dayNamesShort: [ "Dom","Seg","Ter","Qua","Qui","Sex","Sáb" ],
dayNamesMin: [ "Dom","Seg","Ter","Qua","Qui","Sex","Sáb" ],
weekHeader: "Sm",
dateFormat: "dd/mm/yy",
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: "" };
datepicker.setDefaults( datepicker.regional[ "pt-BR" ] );
return datepicker.regional[ "pt-BR" ];
} ) );
$(function() {
$("#datepicker").datepicker();
});
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<p>Date: <input type="text" id="datepicker"></p>
Someone can help me?
Your question is vague, what is the code ?
– novic
is on the site I left above, but follows here also "<script> $( Function() { $( "#datepicker" ).datepicker(); } ); </script> <p>Date: <input type="text" id="datepicker"></p>"
– José Gomes
to receive the value of datepicker is that I do not know the code
– José Gomes
I asked your question the example of the code is in English, and you wanted the date in Portuguese?
– novic
No. I want instead of receiving in string be in date so that regardless of where in the world the site runs there are no errors in the date format
– José Gomes
Where are you running this... are you sending the value to where? That I don’t understand!
– novic
To store the date of birth in the database
– José Gomes
if you have to put this code!
– novic
Let’s go continue this discussion in chat.
– José Gomes