Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Jan 29, 2025
1 parent 9dc4ce5 commit 0aa118e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ const CustomCalendarHeaderRoot = styled('div')({
function CustomCalendarHeader(props) {
const { currentMonth, onMonthChange } = props;

const selectNextMonth = () => onMonthChange(currentMonth.add(1, 'month'), 'left');
const selectNextYear = () => onMonthChange(currentMonth.add(1, 'year'), 'left');
const selectPreviousMonth = () =>
onMonthChange(currentMonth.subtract(1, 'month'), 'right');
const selectPreviousYear = () =>
onMonthChange(currentMonth.subtract(1, 'year'), 'right');
const selectNextMonth = () => onMonthChange(currentMonth.add(1, 'month'));
const selectNextYear = () => onMonthChange(currentMonth.add(1, 'year'));
const selectPreviousMonth = () => onMonthChange(currentMonth.subtract(1, 'month'));
const selectPreviousYear = () => onMonthChange(currentMonth.subtract(1, 'year'));

return (
<CustomCalendarHeaderRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ const CustomCalendarHeaderRoot = styled('div')({
function CustomCalendarHeader(props: PickersCalendarHeaderProps) {
const { currentMonth, onMonthChange } = props;

const selectNextMonth = () => onMonthChange(currentMonth.add(1, 'month'), 'left');
const selectNextYear = () => onMonthChange(currentMonth.add(1, 'year'), 'left');
const selectPreviousMonth = () =>
onMonthChange(currentMonth.subtract(1, 'month'), 'right');
const selectPreviousYear = () =>
onMonthChange(currentMonth.subtract(1, 'year'), 'right');
const selectNextMonth = () => onMonthChange(currentMonth.add(1, 'month'));
const selectNextYear = () => onMonthChange(currentMonth.add(1, 'year'));
const selectPreviousMonth = () => onMonthChange(currentMonth.subtract(1, 'month'));
const selectPreviousYear = () => onMonthChange(currentMonth.subtract(1, 'year'));

return (
<CustomCalendarHeaderRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ const CustomCalendarHeaderRoot = styled('div')({
function CustomCalendarHeader(props) {
const { currentMonth, onMonthChange, month, calendars, monthIndex } = props;

const selectNextMonth = () =>
onMonthChange(currentMonth.add(calendars, 'month'), 'left');
const selectNextMonth = () => onMonthChange(currentMonth.add(calendars, 'month'));
const selectPreviousMonth = () =>
onMonthChange(currentMonth.subtract(calendars, 'month'), 'right');
onMonthChange(currentMonth.subtract(calendars, 'month'));

return (
<CustomCalendarHeaderRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ const CustomCalendarHeaderRoot = styled('div')({
function CustomCalendarHeader(props: PickersRangeCalendarHeaderProps) {
const { currentMonth, onMonthChange, month, calendars, monthIndex } = props;

const selectNextMonth = () =>
onMonthChange(currentMonth.add(calendars, 'month'), 'left');
const selectNextMonth = () => onMonthChange(currentMonth.add(calendars, 'month'));
const selectPreviousMonth = () =>
onMonthChange(currentMonth.subtract(calendars, 'month'), 'right');
onMonthChange(currentMonth.subtract(calendars, 'month'));

return (
<CustomCalendarHeaderRoot>
Expand Down

0 comments on commit 0aa118e

Please sign in to comment.