Created
June 1, 2013 17:09
-
-
Save sbarrat/5691044 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Demo de datepicker inline en castellano | |
Autor: Ruben Lacasa Mas <http://rubenlacasa.es> | |
--> | |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="author" content="Ruben Lacasa Mas - rubenlacasa.es"> | |
<meta name="description" content="Demo de jQuery inline en castellano"> | |
<title>datepicker demo</title> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/flick/jquery-ui.min.css"> | |
<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
</head> | |
<body> | |
<div id="datepicker"></div> | |
<div id="datos"> | |
<label for='fecha'>Fecha:</label> | |
<!-- Campo de texto que recibira el valor seleccionado en el datepicker | |
le he puesto el atributo readonly para no poder escribir directamente --> | |
<input type='text' name='fecha' id='fecha' readonly /> | |
</div> | |
<script> | |
$( "#datepicker" ).datepicker({ | |
// Formato de la fecha | |
dateFormat: "dd/mm/yy", | |
// Primer dia de la semana El lunes | |
firstDay: 1, | |
// Dias Largo en castellano | |
dayNames: [ "Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado" ], | |
// Dias cortos en castellano | |
dayNamesMin: [ "Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa" ], | |
// Nombres largos de los meses en castellano | |
monthNames: [ "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" ], | |
// Nombres de los meses en formato corto | |
monthNamesShort: [ "Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dec" ], | |
// Cuando seleccionamos la fecha esta se pone en el campo Input | |
onSelect: function(dateText) { | |
$('#fecha').val(dateText); | |
} | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment