@byu-oit/vue-decision-processing-components 8.37.3 → 8.38.0

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.
Files changed (2) hide show
  1. package/dateTimeFormat.js +28 -0
  2. package/package.json +1 -1
package/dateTimeFormat.js CHANGED
@@ -54,6 +54,20 @@ export const yearTermFormat = value => {
54
54
  return value.substr(0, 4).concat(term)
55
55
  }
56
56
 
57
+ export const yearTermFormatV2 = value => {
58
+ if (!value) return value
59
+ if (!/^[0-9]{4}[1-6]$/.test(value)) return value
60
+ const term = {
61
+ 1: 'W1',
62
+ 2: 'W2',
63
+ 3: 'S1',
64
+ 4: 'S2',
65
+ 5: 'F1',
66
+ 6: 'F2'
67
+ }[value.substr(-1)]
68
+ return value.substr(0, 4).concat(term)
69
+ }
70
+
57
71
  export const yearTermLongFormat = value => {
58
72
  if (!value) return value
59
73
  if (!/^[0-9]{4}[1345]$/.test(value)) return value
@@ -65,3 +79,17 @@ export const yearTermLongFormat = value => {
65
79
  }[value.substr(-1)]
66
80
  return `${term} ${value.substr(0, 4)}`
67
81
  }
82
+
83
+ export const yearTermLongFormatV2 = value => {
84
+ if (!value) return value
85
+ if (!/^[0-9]{4}[1-6]$/.test(value)) return value
86
+ const term = {
87
+ 1: 'Winter 1',
88
+ 2: 'Winter 2',
89
+ 3: 'Spring 1',
90
+ 4: 'Spring 2',
91
+ 5: 'Fall 1',
92
+ 6: 'Fall 2'
93
+ }[value.substr(-1)]
94
+ return `${term} ${value.substr(0, 4)}`
95
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byu-oit/vue-decision-processing-components",
3
- "version": "8.37.3",
3
+ "version": "8.38.0",
4
4
  "description": "Vue components shared between decision processing systems for the CES schools.",
5
5
  "dependencies": {
6
6
  "@fortawesome/fontawesome-free": "^5.15.4",