Skip to content

Commit

Permalink
Merge pull request #41 from indec-it/fix/datepicker
Browse files Browse the repository at this point in the history
fix(datepicker): fix format
  • Loading branch information
maximilianoforlenza authored Feb 5, 2023
2 parents 093213f + 705c96a commit ec08bbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@indec/form-builder",
"version": "1.4.0",
"version": "1.4.1",
"description": "Form builder",
"main": "index.js",
"private": false,
Expand Down
13 changes: 8 additions & 5 deletions src/components/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ function DatePicker({
renderInput={params => (
<TextField
{...params}
form={form}
field={{...field, name: isRange ? `${field.name}.start` : field.name}}
{...props}
form={form}
field={{
...field,
name: isRange ? `${field.name}.start` : field.name,
value: params.inputProps.value
}}
required={required}
/>
)}
Expand All @@ -44,13 +48,12 @@ function DatePicker({
renderInput={params => (
<TextField
{...params}
form={form}
field={{...field, name: `${field.name}.end`}}
{...props}
form={form}
field={{...field, name: `${field.name}.end`, value: params.inputProps.value}}
required={required}
/>
)}
minDateTime={new Date(field.value.start)}
disabled={!field.value.start}
/>
)}
Expand Down

0 comments on commit ec08bbc

Please sign in to comment.