$(document).ready(function() {
var disabledDays = ["3-31-2013", "4-1-2013", "5-1-2013", "5-9-2013", "5-19-2013", "5-20-2013", "7-11-2013", "7-21-2013", "8-15-2013", "9-27-2013", "11-1-2013", "11-2-2013", "11-11-2013", "11-15-2013", "12-25-2013" ];
function disableAllTheseDays(date) {
var m = date.getMonth(), d = date.getDate(), y = date.getFullYear();
var isWeekend = disableWeekend(date);
if(isWeekend=='false'){
return [false];
}
for (i = 0; i < disabledDays.length; i++) {
if($.inArray((m+1) + '-' + d + '-' + y,disabledDays) != -1) {
return [false];
}
}
return [true];
}
function disableWeekend(date) {
var day = date.getDay();
if((day==0) || (day==1)){
return [false];
}
else{
return[true];
}
}
$('#datum').datepicker({
dateFormat: 'dd-mm-yy',
beforeShowDay: disableAllTheseDays,
});
});
Now more about my jQuery problem, the time picker script is working, but now it works only in 2 apart textfields. I would like this script working in one text field. So, if it's Tuesday, Thursday, Friday or Saturday, it gives me the first textfield and if it's Wednesday the second textfield. Can someone help me?
first textfield:
jQuery(function($){
$('#uur').timepicker({
firstDay: 1,
showPeriodLabels: true,
showPeriod: false,
onHourShow: OnHourShowCallback,
onMinuteShow: OnMinuteShowCallback
});
function OnHourShowCallback(hour) {
if ((hour > 22) || (hour < 12)) {
return false; // not valid
}
return true; // valid
}
function OnMinuteShowCallback(hour, minute) {
if ((hour == 22) && (minute >= 35)) { return false; } // not valid
if ((hour == 6) && (minute < 00)) { return false; } // not valid
return true; // valid
}
});
Second textfield
jQuery(function($){
$('#uur_1').timepicker({
firstDay: 1,
showPeriodLabels: true,
showPeriod: false,
onHourShow: OnHourShowCallback,
onMinuteShow: OnMinuteShowCallback
});
function OnHourShowCallback(hour) {
if ((hour > 15) || (hour < 12)) {
return false; // not valid
}
return true; // valid
}
function OnMinuteShowCallback(hour, minute) {
if ((hour == 15) && (minute >= 05)) { return false; } // not valid
if ((hour == 6) && (minute < 00)) { return false; } // not valid
return true; // valid
}
});