We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4241a5 commit 754c686Copy full SHA for 754c686
packages/rhf-mui/src/utils.ts
@@ -24,6 +24,12 @@ export function getTimezone<TDate extends PickerValidDate>(
24
export function readValueAsDate<TDate extends PickerValidDate>(
25
adapter: ReturnType<typeof useLocalizationContext>,
26
value: string | null | TDate
27
-): TDate | null {
28
- return value && typeof value === 'string' ? adapter.utils.date(value) as TDate: null
+): TDate | null | string {
+ if(typeof value === 'string'){
29
+ if(value === ''){
30
+ return null
31
+ }
32
+ return adapter.utils.date(value) as TDate
33
34
+ return value
35
}
0 commit comments