A custom calendar widget for Tabris.js.
The widget provides basic support to show and pick a date.
The Tabris.js project provides documentation on how to use Cordova plugins in your projects. To include this calendar plugin you have to add a <plugin> element to your projects config.xml:
<plugin name="https://github.com/eclipsesource/tabris-calendar.git" />Widget name: ESCalendar
The following properties can be applied on top of the common Tabris.js properties:
date: String- The currently selected date as a unix timestamp in milliseconds
widget: ESCalendar- The widget the event happend on
date: String- The new date as a unix timestamp in milliseconds
The following snippet shows how the widget can be used in an app:
var page = tabris.create("Page", {
title: "Calendar Widget",
topLevel: true
});
tabris.create("Button", {
id: "button",
text: "Get Date",
layoutData: {left: 16, right: 16, bottom: 16}
}).on("select", function() {
var date = page.children("#calendar").get("date");
console.log("date: " + new Date(parseInt(date)).toUTCString());
}).appendTo(page);
tabris.create("ESCalendar", {
id: "calendar",
date: new Date("October 13, 2014").getTime(),
layoutData: {left: 0, right: 0, top: 0, bottom: "#button 16"}
}).on("change:date", function(widget, date) {
console.log(new Date(parseInt(date)).toUTCString());
}).appendTo(page);
page.open();Compatible with Tabris.js 1.2.0
- tabris-android
While not required by the consumer or the widget, this repository provides a project folder that contains platform specific development artifacts. These artifacts allow to more easily consume the native source code when developing the native parts of the widget.
The project provides a gradle based build configuration, which also allows to import the project into Android Studio.
In order to reference the Tabris.js specific APIs, the environment variable TABRIS_ANDROID_CORDOVA_PLATFORM has to point to the Tabris.js Android Cordova platform root directory.
export TABRIS_ANDROID_CORDOVA_PLATFORM=/home/user/tabris-android-cordovaThe environment variable is consumed in the gradle projects build.gradle file.
See LICENSE notice.
