@eeplatform/nuxt-layer-common 1.7.46 → 1.7.47
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 +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1496,6 +1496,18 @@ const birthdateRules = [
|
|
|
1496
1496
|
}
|
|
1497
1497
|
return age >= 5 || "Learner must be at least 5 years old (Kindergarten age)";
|
|
1498
1498
|
},
|
|
1499
|
+
(v: any) => {
|
|
1500
|
+
if (!v) return true;
|
|
1501
|
+
const date = parseBirthdate(v);
|
|
1502
|
+
if (date.toString() === "Invalid Date") return true;
|
|
1503
|
+
const today = new Date();
|
|
1504
|
+
let age = today.getFullYear() - date.getFullYear();
|
|
1505
|
+
const monthDiff = today.getMonth() - date.getMonth();
|
|
1506
|
+
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < date.getDate())) {
|
|
1507
|
+
age--;
|
|
1508
|
+
}
|
|
1509
|
+
return age <= 80 || "Learner must be at most 80 years old";
|
|
1510
|
+
},
|
|
1499
1511
|
];
|
|
1500
1512
|
|
|
1501
1513
|
const enrollment = defineModel<TLearner>({
|