Skip to Content

Calendar control modification

Hello experts,

We are creating a custom fiori application in which we need to modify the calendar control.

our requirement is as shown below;

What we have achieved is :

1. background color using

calendar.toggleDatesType([ "2013/04/12" ], sap.me.CalendarEventType.Type07, true);

2. meaning of colors using CALENDAR LEGEND.

What we need now :

1. Custom labels below date

2. On click of date open an Action sheet to select few actions. for e.g Regularize the attendance

I have also found that using extend() method we can extend existing controls.

I have also gone through the below links

Documentation/AdvancedTopics/OnTheFlyControlDefinition – SAPUI5 Wiki (TIP CORE User Interface)

Documentation/AdvancedTopics/OnTheFlyControlExample – SAPUI5 Wiki (TIP CORE User Interface)

Documentation/AdvancedTopics/CompositeControl – SAPUI5 Wiki (TIP CORE User Interface)

Still struggling to extend a calendar control. please help.

Regards,

KK

test.PNG (22.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 29, 2014 at 11:38 AM

    Got the solution . 😊

    I have used onAfterrRendering() method of sap.ui.core.Control.

    code:

    
    calendar = new sap.me.Calendar({
      dayHeight:80,
      monthsPerRow : 1,
      currentDate : "2013/04/30",
      });
    
    calendar.onAfterRendering = function(oEvent) { 
      var divs = $('.sapMeCalendarMonthDays').children();
      var i;
      var length = divs.length;
      var classes;
      for(i=0;i<length;i++)
      {
      classes = $(divs[i]).attr('class');
      $(divs[i]).append('<br/><span style="width:100%;display:block;font-size:0.5em;font-weight:bold; color:green">In:10:30</span><span style="width:100%;display:block;font-size:0.5em;font-weight:bold; color:green">Out:06:30</span>');
    //check the condition 
     if(i==3)
      $(divs[i]).addClass('sapMeCalendarType04');
      }
      };
    

    out put.


    asdadadas.JPG (39.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 16, 2016 at 08:06 AM

    Good Day Krishnakant


    I cant open any of the documents you listed below, i would like to have a calendar with color of specific day depending.


    I would appreciate your help 😊


    Thank you

    Add comment
    10|10000 characters needed characters exceeded