Giter Site home page Giter Site logo

eclipsesource / tabris-plugin-calendar Goto Github PK

View Code? Open in Web Editor NEW
4.0 19.0 1.0 246 KB

A custom calendar widget for Tabris.js

License: BSD 3-Clause "New" or "Revised" License

JavaScript 41.04% Kotlin 58.96%
tabris-js tabris calendar-widget android

tabris-plugin-calendar's Introduction

Tabris.js Calendar Plugin

A calendar widget for Tabris.js, allowing to show and pick a date. Currently only Android is supported.

Calendar widget on Android

Compatibility

Compatible with Tabris.js 3.x. For Tabris.js 2.x compatibility see the branch 1.x-tabris-2.x.

Example

The following snippet shows how the tabris-plugin-calendar plugin can be used in a Tabris.js app:

new escalendar.Calendar({
  left: 0, right: 0, top: 0, bottom: 0,
  date: 946684800000 // year 2000
}).on('dateChanged', ({value: date}) => console.log(date))
  .appendTo(tabris.ui.contentView);

A more elaborate example can be found in the example folder. It provides a Tabris.js project that demonstrates the various features of the tabris-plugin-calendar widget. Consult the README of the example for build instructions.

Integrating the plugin

The Tabris.js website provides detailed information on how to integrate custom widgets in your Tabris.js app. To add the plugin to your app add the following entry in your apps config.xml:

<plugin name="tabris-plugin-calendar" spec="^1.0.0" />

To fetch the latest development version use the GitHub URL:

<plugin name="tabris-plugin-calendar" spec="https://github.com/eclipsesource/tabris-plugin-calendar.git" />

API

The widget api consists of the object escalendar.Calendar with the following properties and events.

Properties

The following properties can be applied on top of the common Tabris.js properties:

  • date : number
    • The currently selected date as a unix timestamp in milliseconds
  • minDate : number
    • The minimum date as a unix timestamp in milliseconds. Defaults to January 1 1900
  • maxDate : number
    • The maximum date as a unix timestamp in milliseconds. Defaults to January 1 2100

Events

dateChanged

Fired when the user selects a date in the calendar widget.

Event parameter
  • event.value: number
    • The new date as a unix timestamp in milliseconds

Supported platforms

  • Android

Development of the widget

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.

Android

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_PLATFORM has to point to the Tabris.js Android Cordova platform root directory.

export TABRIS_ANDROID_PLATFORM=/home/user/tabris-android-cordova

The environment variable is consumed in the gradle projects build.gradle file.

Copyright

See LICENSE notice.

tabris-plugin-calendar's People

Contributors

cookieguru avatar cpetrov avatar elshadsm avatar jkrause avatar mpost avatar tbuschto avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

techprd

tabris-plugin-calendar's Issues

Question - Way to go to past years

Great plugin, just started using. Is there a way to go to past years say i want to save my dad's birthday in 1900's.. On tapping the month-year, nothing happens. May be am i missing something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.