@bolttech/form-engine-core 0.0.1-beta.20 → 0.0.1-beta.21

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/index.esm.js +8 -0
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -2155,6 +2155,14 @@ const validDate = (value, validations) => {
2155
2155
  const month = parseInt(dateParts[0], 10) - 1; // Month is zero-based
2156
2156
  const day = parseInt(dateParts[1], 10);
2157
2157
  const date = new Date(year, month, day);
2158
+ /* This line is here because we need to guarantee that the field will not be valid while typing,
2159
+ * that is, imagine the scenario where the user wants to type 1995, when typing 19 or 199,
2160
+ * the function returns valid, as there is a year 19 or 199.
2161
+ */
2162
+ console.log('ValidDate: ', date.getFullYear());
2163
+ if (date.getFullYear() < 1900) {
2164
+ return true;
2165
+ }
2158
2166
  // Check if the date is valid
2159
2167
  const isValidDate = date.getFullYear() === year && date.getMonth() === month && date.getDate() === day;
2160
2168
  return !isValidDate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "0.0.1-beta.20",
3
+ "version": "0.0.1-beta.21",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",