Prem
Prem

Reputation: 41

Select only month and year on sap.m.Datepicker control Openui5

I am using sap.m.Datepicker, On clicking of date icon a calendar is rendered showing current month and all dates. Instead of showing dates, I only want to show up a calendar with months selection.

Datepicker control showing month dates

Date picker showing months (this is what I am looking for, on click of date icon)

Upvotes: 4

Views: 5582

Answers (2)

Sunil B N
Sunil B N

Reputation: 4225

Previously with standard(version < 1.68) sap.m.Datepicker its not possible to show only months with years.

Update: As of SAP UI5 1.68, DatePicker is capable of displaying the month-picker only. To enable it, displayFormat and valueFormat should be "MM/yyyy" and for only year "yyyy"

Upvotes: 3

user12354973
user12354973

Reputation: 1

This can done by :

var oCalendar = new sap.ui.unified.CalendarMonthInterval({              
  width: "100%",
  select: this.handleCalendarSelect.bind(this),
}),

Upvotes: 0

Related Questions