3

Need a help in Ant Calendar

    import { Calendar } from 'antd';

function onPanelChange(value, mode) {
  console.log(value, mode);
}

ReactDOM.render(
  <Calendar onPanelChange={onPanelChange} />,
  mountNode);

I need remove default MONTH, YEAR buttons and other options.

Thank you!

3 Answers3

2
const headerRender = () => null;

<Calendar
  headerRender={headerRender}
/>
  • 3
    Welcome to StackOverflow. Plain code answers can almost always be improved by providing some explanation. Consider adding a sentence or two, or a link to the documentation that led you to your solution, for example. – jdaz Jun 03 '20 at 23:27
  • This works. It returns a null node. – Garrick Crouch Jul 23 '23 at 04:11
1
.ant-fullcalendar-header{
  display:none;
}

https://github.com/ant-design/ant-design/issues/12373

bkent
  • 11
  • 1
  • So, what happens when this project dies and the link is dead? Is this an answer that has a lifetime worthy of more than a comment? –  Oct 22 '18 at 20:06
1

For now, there exist no exact solution. But you can use some trick:

Give a custom class name to the calendar component and add below css code

.<customClassName>  .ant-fullcalendar-header .ant-radio-group {
    display: none !important
}
prasid444
  • 325
  • 1
  • 10