@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eeplatform/nuxt-layer-common
2
2
 
3
+ ## 1.7.47
4
+
5
+ ### Patch Changes
6
+
7
+ - 7b536bb: Fix enrollment form, birthdate limit
8
+
3
9
  ## 1.7.46
4
10
 
5
11
  ### Patch Changes
@@ -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>({
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.46",
5
+ "version": "1.7.47",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"