File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/form-state-manager/src/files Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ const sanitizeValue = (event: OnChangeEvent): any => {
37
37
* @param {Any } value Any JS variable to be check if is empty
38
38
*/
39
39
export const checkEmpty = ( value : any ) => {
40
+ if ( typeof value === 'object' && value instanceof Date ) {
41
+ return false ;
42
+ }
43
+
40
44
if ( typeof value === 'number' ) {
41
45
return false ;
42
46
}
@@ -57,7 +61,6 @@ const defaultParse = (value?: any) => (value === '' ? undefined : value);
57
61
58
62
const useField = ( {
59
63
name,
60
- initialValue,
61
64
clearOnUnmount,
62
65
initializeOnMount,
63
66
validate,
@@ -82,7 +85,9 @@ const useField = ({
82
85
83
86
registerField ( {
84
87
name,
85
- initialValue : dataType ? convertValue ( initialValue , dataType ) : initialValue ,
88
+ ...( Object . prototype . hasOwnProperty . call ( props , 'initialValue' ) && {
89
+ initialValue : dataType ? convertValue ( props . initialValue , dataType ) : props . initialValue
90
+ } ) ,
86
91
initializeOnMount,
87
92
render,
88
93
validate,
You can’t perform that action at this time.
0 commit comments