-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
385 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import TextField from '@mui/material/TextField'; | ||
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; | ||
import { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker'; | ||
|
||
const adapter = new AdapterDateFns(); | ||
export default function CustomizeDayPicker() { | ||
const [value, setValue] = React.useState(adapter.date()); | ||
|
||
return ( | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> | ||
<StaticDatePicker | ||
displayStaticWrapperAs="desktop" | ||
value={value} | ||
onChange={(newValue) => { | ||
setValue(newValue); | ||
}} | ||
renderInput={(params) => <TextField {...params} />} | ||
dayOfWeekFormatter={(day) => `${day}.`} | ||
toolbarFormat="eee dd MMMM" | ||
showToolbar | ||
/> | ||
</LocalizationProvider> | ||
); | ||
} |
26 changes: 26 additions & 0 deletions
26
docs/data/date-pickers/localization/CustomizeDayPicker.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,26 @@ | ||
import * as React from 'react'; | ||
import TextField from '@mui/material/TextField'; | ||
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; | ||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; | ||
import { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker'; | ||
|
||
const adapter = new AdapterDateFns(); | ||
export default function CustomizeDayPicker() { | ||
const [value, setValue] = React.useState<Date | null>(adapter.date()); | ||
|
||
return ( | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> | ||
<StaticDatePicker | ||
displayStaticWrapperAs="desktop" | ||
value={value} | ||
onChange={(newValue) => { | ||
setValue(newValue); | ||
}} | ||
renderInput={(params) => <TextField {...params} />} | ||
dayOfWeekFormatter={(day) => `${day}.`} | ||
toolbarFormat="eee dd MMMM" | ||
showToolbar | ||
/> | ||
</LocalizationProvider> | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
docs/data/date-pickers/localization/CustomizeDayPicker.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,13 @@ | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> | ||
<StaticDatePicker | ||
displayStaticWrapperAs="desktop" | ||
value={value} | ||
onChange={(newValue) => { | ||
setValue(newValue); | ||
}} | ||
renderInput={(params) => <TextField {...params} />} | ||
dayOfWeekFormatter={(day) => `${day}.`} | ||
toolbarFormat="eee dd MMMM" | ||
showToolbar | ||
/> | ||
</LocalizationProvider> |
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
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.