@bolttech/form-engine-core 0.0.1-beta.22 → 0.0.1-beta.24
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/index.esm.js +7 -4
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -2090,13 +2090,13 @@ const betweenDates = (value, validations) => {
|
|
|
2090
2090
|
* ```
|
|
2091
2091
|
*/
|
|
2092
2092
|
const date = (value, validations) => {
|
|
2093
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
2093
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
2094
2094
|
if (!((_b = (_a = validations.date) === null || _a === void 0 ? void 0 : _a.target) === null || _b === void 0 ? void 0 : _b.value) && !((_d = (_c = validations.date) === null || _c === void 0 ? void 0 : _c.origin) === null || _d === void 0 ? void 0 : _d.intervals)) {
|
|
2095
2095
|
return false;
|
|
2096
2096
|
}
|
|
2097
2097
|
const originValue = validations.date.origin.value || value;
|
|
2098
2098
|
const mappedValue = dateRearrangeMapper[(_e = validations.date) === null || _e === void 0 ? void 0 : _e.origin.format](originValue).toString();
|
|
2099
|
-
console.log('date: ', value, invalidStringDate(mappedValue, (_f = validations.date) === null || _f === void 0 ? void 0 : _f.origin.format));
|
|
2099
|
+
console.log('date (invalidStringDate): ', value, invalidStringDate(mappedValue, (_f = validations.date) === null || _f === void 0 ? void 0 : _f.origin.format));
|
|
2100
2100
|
if (invalidStringDate(mappedValue, (_g = validations.date) === null || _g === void 0 ? void 0 : _g.origin.format)) return false;
|
|
2101
2101
|
let originDate = new Date(mappedValue);
|
|
2102
2102
|
let targetDate = new Date();
|
|
@@ -2127,7 +2127,11 @@ const date = (value, validations) => {
|
|
|
2127
2127
|
'===': originTimestamp === targetTimestamp,
|
|
2128
2128
|
'!==': originTimestamp !== targetTimestamp
|
|
2129
2129
|
};
|
|
2130
|
-
|
|
2130
|
+
console.log('date (operationsMapper): ', {
|
|
2131
|
+
originDate,
|
|
2132
|
+
targetDate
|
|
2133
|
+
}, operationsMapper[(_o = validations.date) === null || _o === void 0 ? void 0 : _o.operator]);
|
|
2134
|
+
return operationsMapper[(_p = validations.date) === null || _p === void 0 ? void 0 : _p.operator];
|
|
2131
2135
|
};
|
|
2132
2136
|
/**
|
|
2133
2137
|
* @function validDate
|
|
@@ -2160,7 +2164,6 @@ const validDate = (value, validations) => {
|
|
|
2160
2164
|
* that is, imagine the scenario where the user wants to type 1995, when typing 19 or 199,
|
|
2161
2165
|
* the function returns valid, as there is a year 19 or 199.
|
|
2162
2166
|
*/
|
|
2163
|
-
console.log('ValidDate: ', value);
|
|
2164
2167
|
if (date.getFullYear() < 1900) {
|
|
2165
2168
|
return true;
|
|
2166
2169
|
}
|