Skip to content

Commit

Permalink
Merge pull request #1084 from ErikParso/feature/parso/date-fns-warnin…
Browse files Browse the repository at this point in the history
…g-fix

fixed pickers warning
  • Loading branch information
lookfirst authored Nov 23, 2023
2 parents 61c419e + 7914010 commit c605678
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function DatePickerWrapper(props: DatePickerWrapperProps) {
fullWidth: true,
name,
onChange,
value,
value: (value as any) === '' ? null : value,
required,
},
}}
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function DateTimePickerWrapper(props: DateTimePickerWrapperProps) {
fullWidth: true,
name,
onChange,
value,
value: (value as any) === '' ? null : value,
required,
},
}}
Expand Down
2 changes: 1 addition & 1 deletion src/TimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function TimePickerWrapper(props: TimePickerWrapperProps) {
fullWidth: true,
name,
onChange,
value,
value: (value as any) === '' ? null : value,
required,
},
}}
Expand Down
20 changes: 10 additions & 10 deletions test/__snapshots__/DatePicker.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ exports[`DatePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -281,7 +281,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
placeholder="YYYY-MM-DD"
required=""
type="text"
value="YYYY-MM-DD"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -313,7 +313,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -324,7 +324,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down Expand Up @@ -352,8 +352,8 @@ exports[`DatePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -380,7 +380,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
placeholder="YYYY-MM-DD"
required=""
type="text"
value="YYYY-MM-DD"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -412,7 +412,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -423,7 +423,7 @@ exports[`DatePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down
20 changes: 10 additions & 10 deletions test/__snapshots__/DateTimePicker.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -281,7 +281,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
placeholder="MM/DD/YYYY hh:mm aa"
required=""
type="text"
value="MM/DD/YYYY hh:mm aa"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -313,7 +313,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -324,7 +324,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down Expand Up @@ -352,8 +352,8 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -380,7 +380,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
placeholder="MM/DD/YYYY hh:mm aa"
required=""
type="text"
value="MM/DD/YYYY hh:mm aa"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -412,7 +412,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -423,7 +423,7 @@ exports[`DateTimePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down
20 changes: 10 additions & 10 deletions test/__snapshots__/TimePicker.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ exports[`TimePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -287,7 +287,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
placeholder="hh:mm aa"
required=""
type="text"
value="hh:mm aa"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -322,7 +322,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -333,7 +333,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down Expand Up @@ -361,8 +361,8 @@ exports[`TimePicker turns red if empty and required 1`] = `
class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-n5zogd-MuiFormControl-root-MuiTextField-root"
>
<label
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error MuiFormLabel-filled Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-sizeMedium MuiInputLabel-outlined css-1jy569b-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="true"
class="MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined MuiFormLabel-colorPrimary Mui-error Mui-required MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-sizeMedium MuiInputLabel-outlined css-14s5rfu-MuiFormLabel-root-MuiInputLabel-root"
data-shrink="false"
for=":r8:"
id=":r8:-label"
>
Expand All @@ -389,7 +389,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
placeholder="hh:mm aa"
required=""
type="text"
value="hh:mm aa"
value=""
/>
<div
class="MuiInputAdornment-root MuiInputAdornment-positionEnd MuiInputAdornment-outlined MuiInputAdornment-sizeMedium css-1laqsz7-MuiInputAdornment-root"
Expand Down Expand Up @@ -424,7 +424,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
class="MuiOutlinedInput-notchedOutline css-1d3z3hw-MuiOutlinedInput-notchedOutline"
>
<legend
class="css-14lo706"
class="css-yjsfm1"
>
<span>
Test
Expand All @@ -435,7 +435,7 @@ exports[`TimePicker turns red if empty and required 1`] = `
</fieldset>
</div>
<p
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained MuiFormHelperText-filled Mui-required css-1wc848c-MuiFormHelperText-root"
class="MuiFormHelperText-root Mui-error MuiFormHelperText-sizeMedium MuiFormHelperText-contained Mui-required css-1wc848c-MuiFormHelperText-root"
id=":r8:-helper-text"
>
date is a required field
Expand Down

0 comments on commit c605678

Please sign in to comment.