Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CalendarLegend to Mark the Calendar Dates

Hi Experts,

I am implementing an application where i need to mark the calendar dates like Week end and holiday.

I am using the controls Calendar and CalendarLegend from the sap.me library. I have the below code snippets and let me know how to connect the Legend to the Calendar.

var oLayout = new sap.ui.commons.layout.MatrixLayout({

  layoutFixed : true,

  columns : 2,

  width : "100%",

  widths : [ "70%", "30%" ]

  });

  //Header

  var oHeader = new sap.ui.commons.TextView({

  text:"WorkingRequest",

  design : sap.ui.commons.TextViewDesign.H1});

  oLayout.createRow({height: "40px"}, oHeader );

  //Calendar Control

  var oCalendar = new sap.me.Calendar("WorkRequestCalendar",

  {design: sap.me.CalendarDesign.Approval});

  // Properties

  oCalendar.setEnableMultiselection(true);

  oCalendar.setSingleRow(false);

  oCalendar.setMonthsToDisplay(2);

  oCalendar.setWeeksPerRow(1);

  oCalendar.setFirstDayOffset(1);

  oCalendar.setMonthsPerRow(2);

  var oLegend = new sap.me.CalendarLegend();

  oLegend.setExpanded(true);

  oLegend.setLegendForType01("Pending Approval");

  oLegend.setLegendForType04("Approved");

  oLegend.setLegendForType06("Rejected");

  var oCalendarCell = new

  sap.ui.commons.layout.MatrixLayoutCell({

  content:oCalendar,

  });

  oLayout.createRow(oCalendarCell,oLegend);

  return oLayout;

I am not sure how to mark the dates with some Legend. Please let know how to achieve this.

Regards,

Urmi

Tags:
Former Member
Former Member replied

Thank you for the example you have provided in jsbin to explain this.

Regards,

Urmi

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question