@fy-/fws-vue 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -139,7 +139,6 @@ const patchUser = async () => {
|
|
|
139
139
|
id="birthdateFWS"
|
|
140
140
|
v-model="state.userData.Birthdate"
|
|
141
141
|
class="mb-4"
|
|
142
|
-
:disableDatesUnder18="true"
|
|
143
142
|
type="datepicker"
|
|
144
143
|
:label="$t('fws_birthdate_label')"
|
|
145
144
|
:error-vuelidate="v$.userData.Birthdate.$errors"
|
|
@@ -105,12 +105,16 @@ const modelCheckbox = computed({
|
|
|
105
105
|
},
|
|
106
106
|
});
|
|
107
107
|
defineExpose({ focus, blur, getInputRef });
|
|
108
|
+
|
|
108
109
|
function disableDateUnder18Func(date: Date) {
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
const today = new Date();
|
|
111
|
+
const date18YearsAgo = new Date(
|
|
112
|
+
today.getFullYear() - 18,
|
|
113
|
+
today.getMonth(),
|
|
114
|
+
today.getDate(),
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return date < date18YearsAgo;
|
|
114
118
|
}
|
|
115
119
|
</script>
|
|
116
120
|
<template>
|
|
@@ -210,7 +214,7 @@ function disableDateUnder18Func(date: Date) {
|
|
|
210
214
|
:placeholder="placeholder"
|
|
211
215
|
as-single
|
|
212
216
|
:disable-date="
|
|
213
|
-
disableDatesUnder18 ? disableDateUnder18Func : undefined
|
|
217
|
+
props.disableDatesUnder18 ? disableDateUnder18Func : undefined
|
|
214
218
|
"
|
|
215
219
|
></VueTailwindDatepicker>
|
|
216
220
|
</div>
|