Skip to content

Commit 422f9ba

Browse files
authored
Merge pull request kenhyuwa#14 from jserranojunior/master
feat: Add "selectedDate" props to display selected date
2 parents 9034b37 + 82ad181 commit 422f9ba

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vue-tailwind-picker.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ export default {
484484
required: false,
485485
default: true,
486486
},
487+
selectedDate: {
488+
type: String,
489+
required: false,
490+
},
487491
startDate: {
488492
type: String,
489493
required: false,
@@ -584,7 +588,9 @@ export default {
584588
const endDatepicker = this.endDate
585589
? dayjs(this.endDate, this.formatDate)
586590
: undefined
587-
const today = dayjs(startDatepicker, this.formatDate)
591+
const today = this.selectedDate && this.startDate < this.selectedDate
592+
? dayjs(this.selectedDate, this.formatDate)
593+
: dayjs(startDatepicker, this.formatDate);
588594
const months = Array.from(Array(12), (v, i) => {
589595
return dayjs().month(i).format('MMMM')
590596
})

0 commit comments

Comments
 (0)