<mvc:View
controllerName="my.CalendarController"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Calendar id="calendar"
startDate="{path: '/startDate', type: 'sap.ui.model.type.Date', formatOptions: {style: 'medium'}}"
rows="6"
months="2"
width="auto"
showWeekNumbers="true"
select="handleCalendarSelect"
change="handleCalendarChange"
invalidate="handleCalendarInvalidate"
eventSelectionChange="handleEventSelectionChange"
eventDelete="handleEventDelete"
eventAdd="handleEventAdd"
eventChange="handleEventChange">
<Appointments>
<Appointment
startDate="{path: 'start', type: 'sap.ui.model.type.Date', formatOptions: {style: 'medium'}}"
endDate="{path: 'end', type: 'sap.ui.model.type.Date', formatOptions: {style: 'medium'}}"
title="{path: 'title', type: 'sap.ui.model.type.String'}"
icon="{path: 'icon', type: 'sap.ui.model.type.String'}"
type="{path: 'type', type: 'sap.ui.model.type.String'}"
tentative="{path: 'tentative', type: 'sap.ui.model.type.Boolean'}"
nonWorking="{path: 'nonWorking', type: 'sap.ui.model.type.Boolean'}"
selected="{path: 'selected', type: 'sap.ui.model.type.Boolean'}"
iconDensityAware="false"
textDirection="Inherit">
</Appointment>
</Appointments>
<SpecialDates>
<SpecialDate
type="NonWorking"
startDate="{path: 'start', type: 'sap.ui.model.type.Date', formatOptions: {style: 'medium'}}"
endDate="{path: 'end', type: 'sap.ui.model.type.Date', formatOptions: {style: 'medium'}}"
tooltip="{path: 'tooltip', type: 'sap.ui.model.type.String'}">
</SpecialDate>
</SpecialDates>
</Calendar>
</mvc:View>
Ce code affiche un calendrier avec le mois en cours. Si vous souhaitez afficher plusieurs mois à la fois, vous pouvez ajuster la propriété months. Par exemple, si vous définissez la propriété months sur 3, le calendrier affichera les trois mois suivants.