|
28 | 28 | <v-text-field |
29 | 29 | v-else |
30 | 30 | class="c-datetime-picker" |
| 31 | + :class="{ 'has-today-btn': showTodayButton }" |
31 | 32 | :placeholder="internalFormat" |
32 | 33 | :append-inner-icon=" |
33 | 34 | internalDateKind == 'time' |
34 | 35 | ? 'fa fa-clock cursor-pointer' |
35 | 36 | : 'fa fa-calendar-alt cursor-pointer' |
36 | 37 | " |
37 | | - :class="{ 'today-btn': showTodayButton }" |
38 | 38 | v-bind="inputBindAttrs" |
39 | 39 | :rules="effectiveRules" |
40 | 40 | :modelValue="internalTextValue == null ? displayedValue : internalTextValue" |
|
87 | 87 | :max="max ? endOfDay(max) : undefined" |
88 | 88 | v-bind="datePickerProps" |
89 | 89 | > |
| 90 | + <template v-slot:actions v-if="showTodayButton"> |
| 91 | + <v-btn @click="setToday"> Today </v-btn> |
| 92 | + <v-spacer /> |
| 93 | + </template> |
90 | 94 | </v-date-picker> |
91 | | - <template v-slot:actions v-if="showTodayButton"> |
92 | | - <v-btn @click="setToday" :disabled="!isDateAllowed(new Date())"> |
93 | | - Today |
94 | | - </v-btn> |
95 | | - <v-spacer /> |
96 | | - </template> |
97 | | - </v-date-picker> |
98 | 95 |
|
99 | 96 | <v-divider vertical></v-divider> |
100 | 97 |
|
|
128 | 125 | } |
129 | 126 | } |
130 | 127 | } |
131 | | -
|
132 | | - .today-btn .c-time-picker__column { |
| 128 | + .has-today-btn { |
133 | 129 | max-height: 365px; |
134 | 130 | } |
135 | | -
|
136 | 131 | .v-date-picker { |
137 | 132 | width: 300px; |
138 | 133 | overflow-y: auto; |
@@ -278,20 +273,21 @@ const props = withDefaults( |
278 | 273 | * Value should divide 60 evenly, or be multiples of 60 */ |
279 | 274 | step?: number | null; |
280 | 275 |
|
281 | | - /** The minimum date/time value allowed. */ |
282 | | - min?: Date | null; |
283 | | - /** The maximum date/time value allowed. */ |
284 | | - max?: Date | null; |
285 | | - /** An array of permitted dates (items should have a time of midnight), |
286 | | - * or a function that returns true if a date is allowed for selection. |
287 | | - * Does not impact time selection. */ |
288 | | - allowedDates?: null | Date[] | ((date: Date) => boolean); |
289 | | - // Object containing extra props to pass through to `v-date-picker`. |
290 | | - datePickerProps?: any; |
291 | | - /** Determines whether the 'Today' button is displayed in the date picker actions. |
292 | | - * When enabled, the 'Today' button allows users to quickly select the current date. */ |
293 | | - showTodayButton?: boolean; |
294 | | - }>(), |
| 276 | + /** The minimum date/time value allowed. */ |
| 277 | + min?: Date | null; |
| 278 | + /** The maximum date/time value allowed. */ |
| 279 | + max?: Date | null; |
| 280 | + /** An array of permitted dates (items should have a time of midnight), |
| 281 | + * or a function that returns true if a date is allowed for selection. |
| 282 | + * Does not impact time selection. */ |
| 283 | + allowedDates?: null | Date[] | ((date: Date) => boolean); |
| 284 | + // Object containing extra props to pass through to `v-date-picker`. |
| 285 | + datePickerProps?: DatePickerProps; |
| 286 | + /** Determines whether the 'Today' button is displayed in the date picker actions. |
| 287 | + * When enabled, the 'Today' button allows users to quickly select the current date. */ |
| 288 | + showTodayButton?: boolean; |
| 289 | + } & /* @vue-ignore */ InheritedProps |
| 290 | + >(), |
295 | 291 | { closeOnDatePicked: null, color: "secondary" } |
296 | 292 | ); |
297 | 293 |
|
|
0 commit comments