hola, muchas gracias por contestar, estuve viendo tu codigo y la verdad no se como adaptarlo al que yo tengo, lo posteo para que me puedas ayudar, mil gracias
Código Javascript
:
Ver originalfunction calendar(){
var startDate;
var endDate;
var selectCurrentWeek = function() {
window.setTimeout(function () {
$('.week-picker').find('.ui-datepicker-current-day a').addClass('ui-state-active')
}, 1);
}
$('.week-picker').datepicker( {
dateFormat: "yy-mm-dd",
firstDay: 1,
calculateWeek: myWeekCalc,
showOtherMonths: true,
selectOtherMonths: true,
showWeek: true,
changeYear: true,
changeMonth: true,
onSelect: function(dateText, inst) {
var date = $(this).datepicker('getDate');
if(date.getDay()==0){
startDate = new Date(date.getFullYear(), date.getMonth(), (date.getDate() - date.getDay())-6);
endDate = new Date(date.getFullYear(), date.getMonth(), ((date.getDate()) - date.getDay()) );
}else{
startDate = new Date(date.getFullYear(), date.getMonth(), (date.getDate() - date.getDay())+1);
endDate = new Date(date.getFullYear(), date.getMonth(), ((date.getDate()) - date.getDay()) + 7);
}
var dateFormat = inst.settings.dateFormat || $.datepicker._defaults.dateFormat;
if(($(this).attr('id'))=="dp1"){
$('#startDate').text($.datepicker.formatDate( dateFormat, startDate, inst.settings ));
$('#endDate').text($.datepicker.formatDate( dateFormat, endDate, inst.settings ));
$('#startDate1').text($.datepicker.formatDate( dateFormat, startDate, inst.settings ));
}else if(($(this).attr('id'))=="dp2"){
$('#startDate2').text($.datepicker.formatDate( dateFormat, startDate, inst.settings ));
$('#endDate2').text($.datepicker.formatDate( dateFormat, endDate, inst.settings ));
}
selectCurrentWeek();
},
beforeShowDay: function(date) {
var cssClass = '';
if(date >= startDate && date <= endDate)
cssClass = 'ui-datepicker-current-day';
return [true, cssClass];
},
onChangeMonthYear: function(year, month, inst) {
selectCurrentWeek();
}
});
}