@eeplatform/nuxt-layer-common 1.5.0 → 1.5.1

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.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ab3086b: Fix school year generator utils
8
+
3
9
  ## 1.5.0
4
10
 
5
11
  ### Minor Changes
@@ -1486,8 +1486,11 @@ const isSeniorHighSchool = computed(() => {
1486
1486
  return ["grade-11", "grade-12"].includes(gradeLevel);
1487
1487
  });
1488
1488
 
1489
- const effectiveSchoolYearOptions = generateSchoolYears();
1490
- const lastSchoolYearOptions = generateSchoolYears(50).reverse();
1489
+ const effectiveSchoolYearOptions = computed(() =>
1490
+ generateSchoolYears(0, "future")
1491
+ );
1492
+
1493
+ const lastSchoolYearOptions = generateSchoolYears(50);
1491
1494
 
1492
1495
  const indigenousCommunitiesPhilippines = [
1493
1496
  // Luzon (Northern Philippines) - Cordillera Groups (Igorot Subgroups)
@@ -1664,7 +1667,6 @@ watchEffect(() => {
1664
1667
  });
1665
1668
 
1666
1669
  import { useMask } from "vuetify";
1667
- import { fa } from "zod/v4/locales";
1668
1670
 
1669
1671
  watchEffect(() => {
1670
1672
  const mask = useMask({ mask: "##/##/####" });
@@ -114,12 +114,24 @@ export default function useBasicEdu() {
114
114
  },
115
115
  ];
116
116
 
117
- function generateSchoolYears(generation = 0) {
117
+ function generateSchoolYears(generation = 0, mode = "past") {
118
118
  const currentYear = new Date().getFullYear();
119
119
  const years = [];
120
- for (let i = currentYear - generation; i <= currentYear; i++) {
121
- years.push(`${i}-${i + 1}`);
120
+
121
+ if (mode === "past") {
122
+ // Generate from current year going back to past years
123
+ for (let i = 0; i <= generation; i++) {
124
+ const year = currentYear - i;
125
+ years.push(`${year}-${year + 1}`);
126
+ }
127
+ } else if (mode === "future") {
128
+ // Generate from current year going forward to future years
129
+ for (let i = 0; i <= generation; i++) {
130
+ const year = currentYear + i;
131
+ years.push(`${year}-${year + 1}`);
132
+ }
122
133
  }
134
+
123
135
  return years;
124
136
  }
125
137
 
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.5.0",
5
+ "version": "1.5.1",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"