hof 19.13.9 → 19.13.10
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/components/date/index.js +6 -4
- package/package.json +1 -1
package/components/date/index.js
CHANGED
@@ -82,13 +82,15 @@ module.exports = (key, opts) => {
|
|
82
82
|
};
|
83
83
|
|
84
84
|
// defaultFormatters on the base controller replace '--' with '-' on the process step.
|
85
|
-
// This ensures having the correct number of hyphens,
|
86
|
-
//
|
85
|
+
// This ensures having the correct number of hyphens, so values do not jump from year to month.
|
86
|
+
// This should only be done on a partially completed date field otherwise the validation messages break.
|
87
87
|
const postProcess = (req, res, next) => {
|
88
|
-
req.form.values[key]
|
88
|
+
const value = req.form.values[key];
|
89
|
+
if (value) {
|
90
|
+
req.form.values[key] = req.body[key];
|
91
|
+
}
|
89
92
|
next();
|
90
93
|
};
|
91
|
-
|
92
94
|
// if date field is included in errorValues, extend
|
93
95
|
// errorValues with the individual components
|
94
96
|
const preGetErrors = (req, res, next) => {
|