Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Tyla <llukas.tyla@gmail.com>
  • Loading branch information
LukasTy authored Sep 19, 2024
1 parent aed3349 commit fde39ca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
18 changes: 8 additions & 10 deletions docs/data/date-pickers/date-picker/DatePickerYearsOrder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import dayjs from 'dayjs';
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 { DatePicker } from '@mui/x-date-pickers/DatePicker';
Expand All @@ -10,15 +9,14 @@ const currentYear = dayjs();
export default function DatePickerYearsOrder() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={['DatePicker']}>
<DatePicker
label="Years in descending order"
maxDate={currentYear}
openTo="year"
views={['year', 'month']}
yearsOrder="desc"
/>
</DemoContainer>
<DatePicker
label="Years in descending order"
maxDate={currentYear}
openTo="year"
views={['year', 'month']}
yearsOrder="desc"
sx={{ minWidth: 250 }}
/>
</LocalizationProvider>
);
}
18 changes: 8 additions & 10 deletions docs/data/date-pickers/date-picker/DatePickerYearsOrder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import dayjs from 'dayjs';
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 { DatePicker } from '@mui/x-date-pickers/DatePicker';
Expand All @@ -10,15 +9,14 @@ const currentYear = dayjs();
export default function DatePickerYearsOrder() {
return (
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DemoContainer components={['DatePicker']}>
<DatePicker
label="Years in descending order"
maxDate={currentYear}
openTo="year"
views={['year', 'month']}
yearsOrder="desc"
/>
</DemoContainer>
<DatePicker
label="Years in descending order"
maxDate={currentYear}
openTo="year"
views={['year', 'month']}
yearsOrder="desc"
sx={{ minWidth: 250 }}
/>
</LocalizationProvider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
openTo="year"
views={['year', 'month']}
yearsOrder="desc"
sx={{ minWidth: 250 }}
/>

0 comments on commit fde39ca

Please sign in to comment.