@eeplatform/nuxt-layer-common 1.7.44 → 1.7.45
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.
- package/CHANGELOG.md +6 -0
- package/components/EnrollmentForm.vue +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -381,6 +381,7 @@
|
|
|
381
381
|
<v-col cols="12">
|
|
382
382
|
<InputMaskDate
|
|
383
383
|
v-model="enrollment.learnerInfo.birthDate"
|
|
384
|
+
:rules="birthdateRules"
|
|
384
385
|
></InputMaskDate>
|
|
385
386
|
</v-col>
|
|
386
387
|
</v-row>
|
|
@@ -1462,6 +1463,21 @@ const prop = defineProps({
|
|
|
1462
1463
|
});
|
|
1463
1464
|
const { requiredRule, debounce } = useUtils();
|
|
1464
1465
|
|
|
1466
|
+
const birthdateRules = [
|
|
1467
|
+
(v: any) => !!v || "Birthdate is required",
|
|
1468
|
+
(v: any) => {
|
|
1469
|
+
if (!v) return true;
|
|
1470
|
+
const date = new Date(v);
|
|
1471
|
+
return date.toString() !== "Invalid Date" || "Invalid date";
|
|
1472
|
+
},
|
|
1473
|
+
(v: any) => {
|
|
1474
|
+
if (!v) return true;
|
|
1475
|
+
const date = new Date(v);
|
|
1476
|
+
if (date.toString() === "Invalid Date") return true;
|
|
1477
|
+
return date <= new Date() || "Birthdate cannot be in the future";
|
|
1478
|
+
},
|
|
1479
|
+
];
|
|
1480
|
+
|
|
1465
1481
|
const enrollment = defineModel<TLearner>({
|
|
1466
1482
|
default: () => useEnrollment().enrollment,
|
|
1467
1483
|
});
|