Iyyappan Rock
Iyyappan Rock

Reputation: 23

Antd Month DatePicker view is not rendering correcty

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

Answers (1)

Srinivasaperumal
Srinivasaperumal

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

Related Questions