Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

         

Calendar (New in SP06)

This plugin enables the ability to find, create and delete calendar entries in the Android or iOS calendar.  It uses the open source Calendar plugin.

For additional details on the Kapsel Calendar plugin see the JavaScript file in a project that includes this plugin at

project_name\plugins\com.sap.mp.cordova.plugins.calendar\www\calendar.js

or the JS Documentation at Kapsel Calendar API Reference.

The following steps will demonstrate an example of using this plugin.

  • Create the project.
    cordova -d create C:\Kapsel_Projects\CalendarDemo com.mycompany.calendar CalendarDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
    cd C:\Kapsel_Projects\CalendarDemo
    cordova -d platform add android

    cordova -d create ~/Documents/Kapsel_Projects/CalendarDemo com.mycompany.calendar CalendarDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"
    cd ~/Documents/Kapsel_Projects/CalendarDemo
    cordova -d platform add ios
  • Add the device plugin and the Kapsel or open source calendar plugin.
    cordova -d plugin add org.apache.cordova.device
    cordova -d plugin add nl.x-services.plugins.calendar
    or
    cordova -d plugin add
    https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin
  • Replace www\index.html with the contents of index.html.

  • Copy the files to the platform directory by running
    cordova -d prepare
  • Use the Android IDE or Xcode to deploy and run the project.

    Press the Create Event button, then the Find Event button.  Open the device calendar.



    Note the Create Recurring, Open Calendar and List Calendar buttons only work with the open source version of the Calendar plugin.
    The open source Calendar plugin also contains additional methods that are platform specific.  For example the Android version contains a method calendar.createEventInteractively that when called creates an entry and then displays it in the calendar and the iOS version has methods named calendar.createCalendar and calendar.createEventInNamedCalendar.


Back to Getting Started With Kapsel

3 Comments