-
Notifications
You must be signed in to change notification settings - Fork 0
/
date-picker.js
27 lines (27 loc) · 954 Bytes
/
date-picker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$(function() {
$("#date").datepicker({
minDate: new Date().getHours() >= 19 ? "+2d" : "+1d",
maxDate: "+7d",
firstDay: 1,
inline: true,
beforeShowDay: function(date) {
var day = date.getDay();
switch (new Date().getDay()) {
case 0:
return [(day != 0 && day != 1 && day != 6), ''];
case 1:
return [(day != 0 && day != 1 && day != 2 && day != 6), ''];
case 2:
return [(day != 0 && day != 1 && day != 2 && day != 3 && day != 6), ''];
case 3:
return [(day != 0 && day != 1 && day != 2 && day != 3 && day != 4 && day != 6), ''];
case 4:
return [(day != 0 && day != 1 && day != 2 && day != 3 && day != 4 && day != 5 && day != 6), ''];
case 5:
return [(day != 0 && day != 1 && day != 6), ''];
case 6:
return [(day != 0 && day != 1 && day != 6), ''];
}
}
});
});