Tema: Datepicker
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/11/2010, 15:57
indigena420
 
Fecha de Ingreso: noviembre-2010
Mensajes: 3
Antigüedad: 13 años, 5 meses
Puntos: 0
Respuesta: Datepicker

ok gracias por tu atencion. Mira el codigo que tengo es este, pero no logro conseguirlo, lo que quiero hacer es lo siguiente: Tengo el datepicker pero al lado tengo un select para elegir una hora ok? Entonces yo quiero si se puede hacer ,
es que cuando elija los domingos solo se activen hasta cierta hora, he pensado en por ejemplo que cuando se seleccione un domingo en el datepicker, aparezca un nuevo select con esas horas , pero lo he intentado y nada...

<script type="text/javascript">


var disabledDays = ["1-6-2011","12-25-2010"];

function nationalDays(date) {
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
for (i = 0; i < disabledDays.length; i++) {
if(ArrayContains(disabledDays,(m+1) + '-' + d + '-' + y) || new Date() > date) {
return [false];
}
}

return [true];
}
function noWeekendsOrHolidays(date) {
var noWeekend = jQuery.datepicker.noWeekends(date);
return noWeekend[0] ? nationalDays(date) : noWeekend;
}

function ArrayIndexOf(array,item,from){
var len = array.length;
for (var i = (from < 0) ? Math.max(0, len + from) : from || 0; i < len; i++){
if (array[i] === item) return i;
}
return -1;
}

function ArrayContains(array,item,from){
return ArrayIndexOf(array,item,from) != -1;
}

jQuery(document).ready(function() {

jQuery(function($){

$.datepicker.regional['es'] = {
clearText: 'Limpiar', clearStatus: '',
closeText: 'Cerrar', closeStatus: '',
prevText: '&#x3c;Ant', prevStatus: '',
prevBigText: '&#x3c;&#x3c;', prevBigStatus: '',
nextText: 'Sig&#x3e;', nextStatus: '',
nextBigText: '&#x3e;&#x3e;', nextBigStatus: '',
currentText: 'Hoy', currentStatus: '',
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
'Julio','Agosto','Septiembre','Octubre','Noviembre ','Diciembre'],
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
'Jul','Ago','Sep','Oct','Nov','Dic'],
monthStatus: '', yearStatus: '',
weekHeader: 'Sm', weekStatus: '',
dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','V iernes','Sábado'],
dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
dayStatus: 'DD', dateStatus: 'D, M d',
dateFormat: 'dd/mm/yy', firstDay: 1,
initStatus: '', isRTL: false,
showMonthAfterYear: false, yearSuffix: ''
};

$.datepicker.setDefaults($.datepicker.regional['es']);
});

jQuery('#datepicker').datepicker({
minDate: new Date(2000, 0, 1),
maxDate: new Date(2015, 5, 31),
dateFormat: 'd-m-yy',
constrainInput: true,
beforeShowDay: nationalDays


});

});


</script>

<script type="text/javascript">
function fechas(){
if (document.contacto.datepicker.value.length==0){
alert("Domingos solo hasta las 16:00")

}
}
</script>