-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fields] New prop dateSeparator on range fields
- Loading branch information
1 parent
58f1859
commit aad4df2
Showing
20 changed files
with
153 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/data/date-pickers/custom-field/MultiInputFieldSeparatorSlotProps.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<DateRangePicker slotProps={{ fieldSeparator: { children: 'to' } }} /> | ||
<DateRangePicker slotProps={{ fieldSeparator: { sx: { color: 'red' } } }} /> | ||
<DateRangePicker slotProps={{ fieldSeparator: { sx: { opacity: 0.5 } } }} /> |
20 changes: 20 additions & 0 deletions
20
docs/data/date-pickers/custom-field/RangeFieldDateSeparator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import { DemoContainer } from '@mui/x-date-pickers/internals/demo'; | ||
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; | ||
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker'; | ||
import { SingleInputDateRangeField } from '@mui/x-date-pickers-pro/SingleInputDateRangeField'; | ||
|
||
export default function RangeFieldDateSeparator() { | ||
return ( | ||
<LocalizationProvider dateAdapter={AdapterDayjs}> | ||
<DemoContainer components={['DateRangePicker', 'DateRangePicker']}> | ||
<DateRangePicker slotProps={{ field: { dateSeparator: ' to ' } }} /> | ||
<DateRangePicker | ||
slotProps={{ field: { dateSeparator: ' to ' } }} | ||
slots={{ field: SingleInputDateRangeField }} | ||
/> | ||
</DemoContainer> | ||
</LocalizationProvider> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
docs/data/date-pickers/custom-field/RangeFieldDateSeparator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as React from 'react'; | ||
import { DemoContainer } from '@mui/x-date-pickers/internals/demo'; | ||
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; | ||
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker'; | ||
import { SingleInputDateRangeField } from '@mui/x-date-pickers-pro/SingleInputDateRangeField'; | ||
|
||
export default function RangeFieldDateSeparator() { | ||
return ( | ||
<LocalizationProvider dateAdapter={AdapterDayjs}> | ||
<DemoContainer components={['DateRangePicker', 'DateRangePicker']}> | ||
<DateRangePicker slotProps={{ field: { dateSeparator: 'to' } }} /> | ||
<DateRangePicker | ||
slotProps={{ field: { dateSeparator: 'to' } }} | ||
slots={{ field: SingleInputDateRangeField }} | ||
/> | ||
</DemoContainer> | ||
</LocalizationProvider> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
docs/data/date-pickers/custom-field/RangeFieldDateSeparator.tsx.preview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<DateRangePicker slotProps={{ field: { dateSeparator: ' to ' } }} /> | ||
<DateRangePicker | ||
slotProps={{ field: { dateSeparator: ' to ' } }} | ||
slots={{ field: SingleInputDateRangeField }} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.