Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers][DateCalendar] Change months with custom header? #13116

Closed
ImamJanjua opened this issue May 13, 2024 · 2 comments
Closed

[pickers][DateCalendar] Change months with custom header? #13116

ImamJanjua opened this issue May 13, 2024 · 2 comments
Labels
component: date picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! customization: extend Logic customizability status: waiting for author Issue with insufficient information support: question Community support but can be turned into an improvement

Comments

@ImamJanjua
Copy link

ImamJanjua commented May 13, 2024

Steps to reproduce

.

Current behavior

.

Expected behavior

.

Context

is it possible to change the month of calendar with custom header, so something like that?

const DateCalendar: React.FC<DateCalendarProps<Date>> = (props) => {

  const Header = () => {
    return (
      <div className="flex flex-row justify-center gap-8 ">
         {/* on press go to next month*/}
        <button>
          <ChevronLeft size={22} />
        </button>
          
          {/* on press go to today*/}
        <button>today</button>

        {/* on press go to previous month*/}
        <button>
          <ChevronRight size={22} />
        </button>
      </div>
    );
  };

  return (
    <ThemeProvider theme={theme}>
      <Calendar
        slots={{
          calendarHeader: Header,
        }}                   />
   
  );
};

Your environment

No response

Search keywords: .

@ImamJanjua ImamJanjua added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 13, 2024
@michelengelen michelengelen changed the title Change months of dateCalendar with custom header? [pickers][DateCalendar] Change months with custom header? May 14, 2024
@michelengelen
Copy link
Member

Yes, this is possible and there is even a full example in the docs: Custom Header Example

Does that help you?

@michelengelen michelengelen added support: question Community support but can be turned into an improvement status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! customization: extend Logic customizability component: date picker This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 14, 2024
Copy link

The issue has been inactive for 7 days and has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! customization: extend Logic customizability status: waiting for author Issue with insufficient information support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants