cancel
Showing results for 
Search instead for 
Did you mean: 

Set start time on sap.m.SinglePlanningCalendar

0 Kudos

Hi,

The sap.m.SinglePlanningCalendar has a startDate property, similarly is there a way to start the Day/Week view start at let's say 1 PM instead of the default 12 AM?

I have a requirement where appointments can't be created before 3 PM so currently the top half of the calendar is empty and I need to scroll down to see any appointments.

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

FiratAsan
Active Participant
0 Kudos

Hello Abdul Moh'd,

I meet your problem and post while looking for an answer to another question. I wanted to share it because it's something I just did (maybe 10 minutes before). I know it's been a long time since your post, but I'm sharing it with the intention of helping those who encounter Calendar apps always popups and similar problem. I hope it helps 🙂

First of all, it is of course possible to set the start and end times of calendar applications.

Under the tag SinglePlanningCalendar, you can do it by adding;

startHour="8"

endHour="20"

fullDay="false"

You can find screenshots of how this looks like below;



<SinglePlanningCalendar

id="SPC1"

class="sapUiSmallMarginTop"

title= "My Calendar"

startHour="8"

endHour="20"

fullDay="false"

viewChange="handleViewChange"

headerDateSelect="handleHeaderDateSelect"

startDateChange="handleStartDateChange"

startDate="{path: '/startDate'}"

appointments="{path: '/appointments'}">

<actions>

<ToggleButton text="Full Day" press="toggleFullDay"/>

<Button id="addNewAppointment1" text="Create" press="handleAppointmentCreate" tooltip="Add new appointment" />

</actions>

<views>

<SinglePlanningCalendarDayView key="DayView" title="Day" />

<SinglePlanningCalendarWorkWeekView key="WorkWeekView" title="Work Week" />

<SinglePlanningCalendarWeekView key="WeekView" title="Week" />

<SinglePlanningCalendarMonthView key="MonthView" title="Month" />

</views>

<appointments>

<unified:CalendarAppointment

title= "{title}"

text= "{text}"

type= "{type}"

icon= "{icon}"

startDate= "{startDate}"

endDate= "{endDate}">

</unified:CalendarAppointment>

</appointments>

</SinglePlanningCalendar>