Skip to content

Commit 3127c2b

Browse files
Merge pull request #33 from garf/master
Allow same date range
2 parents e19bc42 + def0681 commit 3127c2b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/FunctionalCalendar.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@
492492
// Start Date not empty, chose date > start date
493493
} else if (this.calendar.dateRange.end.date === false && (clickDate > startDate)) {
494494
this.calendar.dateRange.end.date = item.date;
495-
// Start date not empty, chose date < start date
496-
} else if (this.calendar.dateRange.start.date !== false && (clickDate < startDate)) {
495+
// Start date not empty, chose date <= start date (also same date range select)
496+
} else if (this.calendar.dateRange.start.date !== false && (clickDate <= startDate)) {
497497
this.calendar.dateRange.end.date = this.calendar.dateRange.start.date;
498498
this.calendar.dateRange.start.date = item.date;
499499
}
@@ -582,6 +582,11 @@
582582
day.isMarked = true;
583583
}
584584
585+
if (startDate && startDate === endDate) {
586+
day.isMouseToLeft = false
587+
day.isMouseToRight = false
588+
}
589+
585590
if (startDate && endDate) {
586591
if (helpCalendar.getDateFromFormat(day.date).getTime() > helpCalendar.getDateFromFormat(startDate)
587592
&& helpCalendar.getDateFromFormat(day.date) < helpCalendar.getDateFromFormat(endDate)) {

0 commit comments

Comments
 (0)