Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

UPDATE #500 #280 #503

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/js/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
dayIndex = 0 + (p.params.firstDay - 1),
today = new Date().setHours(0,0,0,0),
minDate = p.params.minDate ? new Date(p.params.minDate).getTime() : null,
maxDate = p.params.maxDate ? new Date(p.params.maxDate).getTime() : null;
maxDate = p.params.maxDate ? new Date(p.params.maxDate).getTime() : null,
disabled;

if (p.value && p.value.length) {
for (i = 0; i < p.value.length; i++) {
Expand Down Expand Up @@ -343,13 +344,19 @@
// Selected
if (currentValues.indexOf(dayDate) >= 0) addClass += ' picker-calendar-day-selected';
// Weekend
if (p.params.weekendDays.indexOf(col - 1) >= 0) {
if (col>5) {
addClass += ' picker-calendar-day-weekend';
}
// Disabled
if ((minDate && dayDate < minDate) || (maxDate && dayDate > maxDate)) {
addClass += ' picker-calendar-day-disabled';
}
// Disable certain date in range or list.
if (p.params.disabled) {
if ( p.params.disabled.includes(formatDate(dayDate)) ) {
addClass += ' picker-calendar-day-disabled';
}
}

dayDate = new Date(dayDate);
var dayYear = dayDate.getFullYear();
Expand Down Expand Up @@ -847,6 +854,7 @@
direction: 'horizontal', // or 'vertical'
minDate: null,
maxDate: null,
disabled: null,
touchMove: true,
animate: true,
closeOnSelect: true,
Expand Down