Reputation: 23
const monthFormat = 'YYYY/MM';
<DatePicker defaultValue={moment('2015/01', monthFormat)} format={monthFormat} picker="month" />
Is not rendering as per month calendar expectation
Upvotes: 2
Views: 1531
Reputation: 46
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.
Upvotes: 3