Skip to content

Commit 3f3c313

Browse files
committed
Update class name & fix merge conflicts
1 parent 2cb4c0b commit 3f3c313

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

src/coalesce-vue-vuetify3/src/components/input/c-datetime-picker.vue

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
<v-text-field
2929
v-else
3030
class="c-datetime-picker"
31+
:class="{ 'has-today-btn': showTodayButton }"
3132
:placeholder="internalFormat"
3233
:append-inner-icon="
3334
internalDateKind == 'time'
3435
? 'fa fa-clock cursor-pointer'
3536
: 'fa fa-calendar-alt cursor-pointer'
3637
"
37-
:class="{ 'today-btn': showTodayButton }"
3838
v-bind="inputBindAttrs"
3939
:rules="effectiveRules"
4040
:modelValue="internalTextValue == null ? displayedValue : internalTextValue"
@@ -87,14 +87,11 @@
8787
:max="max ? endOfDay(max) : undefined"
8888
v-bind="datePickerProps"
8989
>
90+
<template v-slot:actions v-if="showTodayButton">
91+
<v-btn @click="setToday"> Today </v-btn>
92+
<v-spacer />
93+
</template>
9094
</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>
9895

9996
<v-divider vertical></v-divider>
10097

@@ -128,11 +125,9 @@
128125
}
129126
}
130127
}
131-
132-
.today-btn .c-time-picker__column {
128+
.has-today-btn {
133129
max-height: 365px;
134130
}
135-
136131
.v-date-picker {
137132
width: 300px;
138133
overflow-y: auto;
@@ -278,20 +273,21 @@ const props = withDefaults(
278273
* Value should divide 60 evenly, or be multiples of 60 */
279274
step?: number | null;
280275
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+
>(),
295291
{ closeOnDatePicked: null, color: "secondary" }
296292
);
297293

0 commit comments

Comments
 (0)