Batuhan-s-Bikes-Website-Alt.../scripts/index.js

37 lines
994 B
JavaScript
Raw Normal View History

2021-03-10 19:14:35 +00:00
// Calendar Validation
function toAppointment() {
document.getElementById('appointment').scrollIntoView();
}
var value = 0;
$(function() {
$("#datepicker").datepicker({
beforeShowDay: getAvailability
});
});
function getMechanic(selectObject) {
value = selectObject.value;
}
function getAvailability(date) {
if (value == 1 && (date.getDay() === 0 || date.getDay() == 6)) /* restrict weekends */
return [false]
if (value == 2 && (date.getDay() === 0 || date.getDay() == 1 || date.getDay() == 4 || date.getDay() == 5 || date.getDay() == 6)) /* restrict M,Thurs, Fri, Sat, Sun */
return [false]
if (value == 3 && (date.getDay() === 0 || date.getDay() == 4 || date.getDay() == 5 || date.getDay() == 6)) /* restrict Thurs, Fri, Sat, Sun */
return [false]
if (date.getDay() === 0 || date.getDay() == 6) /* weekends */
return [false]
else
return [true, "", ""]
}
//Form Validation
function validateForm(){
//first check that the user has selected,
}