@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/nuxt-layer-common
2
2
 
3
+ ## 1.7.45
4
+
5
+ ### Patch Changes
6
+
7
+ - 3965149: Fix enrollment birthdate validation
8
+
3
9
  ## 1.7.44
4
10
 
5
11
  ### Patch Changes
@@ -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
  });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@eeplatform/nuxt-layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.7.44",
5
+ "version": "1.7.45",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"