Antd Month DatePicker view is not rendering correcty

Viewed 511
const monthFormat = 'YYYY/MM';
<DatePicker defaultValue={moment('2015/01', monthFormat)} format={monthFormat} picker="month" />

Is not rendering as per month calendar expectation

1 Answers

I have also got the issue. As per the Antd documentation I have mention picker type in the component. But it's not working. Then I have tried another way.

Import month picker directly from the antd datepicker.

const { RangePicker, MonthPicker } = DatePicker;

Then I have used MonthPicker component like as below.

<MonthPicker placeholder="Select month" />

It's working as per your expectation. Try with this.

Related