Skip to content

Commit 7fa7616

Browse files
committed
Added helpers classes
1 parent 97bbe8a commit 7fa7616

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/Demo.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
:is-date-range="true"
1111
:is-multiple="true"
1212
:calendars-count="2"
13+
:marked-date-range="{start: '22.4.2019', end: '24.4.2019'}"
1314
ref="calendar"
1415
></functional-calendar>
1516
<blockquote>
@@ -79,7 +80,7 @@
7980
8081
.demo-calendar {
8182
margin: 80px 50px;
82-
width: 635px
83+
width: 735px
8384
}
8485
8586
pre {

src/assets/scss/calendar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ input.vfc-single-input {
230230
}
231231

232232
&.vfc-marked {
233-
&.borderd {
233+
&.vfc-borderd, &.vfc-start-marked, &.vfc-end-marked {
234234
&:before {
235235
background: transparent;
236236
}

src/components/FunctionalCalendar.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,12 +623,22 @@
623623
classes.push('vfc-marked');
624624
}
625625
626+
if(this.fConfigs.markedDates.includes(day.date)){
627+
classes.push('vfc-borderd');
628+
}
629+
626630
// Date Range Marked
627631
if (this.fConfigs.markedDateRange.start && this.fConfigs.markedDateRange.end) {
628632
if (helpCalendar.getDateFromFormat(this.fConfigs.markedDateRange.start) <= helpCalendar.getDateFromFormat(day.date)
629633
&& helpCalendar.getDateFromFormat(this.fConfigs.markedDateRange.end) >= helpCalendar.getDateFromFormat(day.date)) {
630634
classes.push('vfc-marked');
631635
}
636+
637+
if(day.date === this.fConfigs.markedDateRange.start){
638+
classes.push('vfc-start-marked');
639+
}else if(day.date === this.fConfigs.markedDateRange.end){
640+
classes.push('vfc-end-marked');
641+
}
632642
} else {
633643
634644
// Only After Start Marked
@@ -660,15 +670,15 @@
660670
}
661671
662672
if(day.date === this.calendar.dateRange.start){
663-
classes.push('vfc-start-date')
673+
classes.push('vfc-start-marked');
664674
}
665675
666676
if(day.date === this.calendar.dateRange.end){
667-
classes.push('vfc-end-date')
677+
classes.push('vfc-end-marked');
668678
}
669679
670-
if(day.date === this.calendar.dateRange.start || day.date === this.calendar.dateRange.end || day.date === this.calendar.selectedDate){
671-
classes.push('borderd');
680+
if(day.date === this.calendar.selectedDate){
681+
classes.push('vfc-borderd')
672682
}
673683
674684
return classes;

0 commit comments

Comments
 (0)