pols-validator 2.3.0 → 2.3.2
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/dist/rules.js +3 -3
- package/package.json +1 -1
- package/src/rules.ts +3 -3
package/dist/rules.js
CHANGED
|
@@ -99,14 +99,14 @@ class PRules extends rulesEngine_1.PRulesEngine {
|
|
|
99
99
|
if (minutes < 60 && seconds < 60) {
|
|
100
100
|
/* Si middle es diferente de vacío, es porque el usuario tiene la intención de especificar una hora del día, caso contrario, está indicando una duración. */
|
|
101
101
|
if (middle) {
|
|
102
|
-
if (hours
|
|
102
|
+
if (hours >= 1 && hours <= 12) {
|
|
103
103
|
if (middle === 'p')
|
|
104
104
|
hours += 12;
|
|
105
105
|
wrapper.value = `${pols_utils_1.PUtils.String.padLeft(hours, 2)}:${pols_utils_1.PUtils.String.padLeft(minutes, 2)}:${pols_utils_1.PUtils.String.padLeft(seconds, 2)}`;
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
else {
|
|
109
|
+
else if (hours >= 0 && hours <= 23) {
|
|
110
110
|
wrapper.value = `${pols_utils_1.PUtils.String.padLeft(hours, 2)}:${pols_utils_1.PUtils.String.padLeft(minutes, 2)}:${pols_utils_1.PUtils.String.padLeft(seconds, 2)}`;
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
@@ -408,7 +408,7 @@ class PRules extends rulesEngine_1.PRulesEngine {
|
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
join(separator) {
|
|
411
|
-
return this.isArray().add(this.
|
|
411
|
+
return this.isArray().add(this.join.name, (wrapper) => {
|
|
412
412
|
wrapper.value = wrapper.value.join(separator);
|
|
413
413
|
});
|
|
414
414
|
}
|
package/package.json
CHANGED
package/src/rules.ts
CHANGED
|
@@ -96,12 +96,12 @@ export class PRules extends PRulesEngine {
|
|
|
96
96
|
if (minutes < 60 && seconds < 60) {
|
|
97
97
|
/* Si middle es diferente de vacío, es porque el usuario tiene la intención de especificar una hora del día, caso contrario, está indicando una duración. */
|
|
98
98
|
if (middle) {
|
|
99
|
-
if (hours
|
|
99
|
+
if (hours >= 1 && hours <= 12) {
|
|
100
100
|
if (middle === 'p') hours += 12
|
|
101
101
|
wrapper.value = `${PUtils.String.padLeft(hours, 2)}:${PUtils.String.padLeft(minutes, 2)}:${PUtils.String.padLeft(seconds, 2)}`
|
|
102
102
|
return
|
|
103
103
|
}
|
|
104
|
-
} else {
|
|
104
|
+
} else if (hours >= 0 && hours <= 23) {
|
|
105
105
|
wrapper.value = `${PUtils.String.padLeft(hours, 2)}:${PUtils.String.padLeft(minutes, 2)}:${PUtils.String.padLeft(seconds, 2)}`
|
|
106
106
|
return
|
|
107
107
|
}
|
|
@@ -405,7 +405,7 @@ export class PRules extends PRulesEngine {
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
join(separator: string) {
|
|
408
|
-
return this.isArray().add(this.
|
|
408
|
+
return this.isArray().add(this.join.name, (wrapper: PRulesWrapper<unknown[]>) => {
|
|
409
409
|
wrapper.value = wrapper.value.join(separator) as any
|
|
410
410
|
})
|
|
411
411
|
}
|