1.0.2 • Published 8 years ago

ionic-time-setter v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Ionic Time Setter

A time selection picker widget for Ionic Framework (v1).

How to use

1) Install it:

$ bower install ionic-time-setter --save

2) Add the js to your html:

<script src="lib/ionic-monthpicker/dist/ionic-time-setter.min.js"></script>

3) Import in your controller:

angular.module('app', ['ionic', 'ionic-time-setter'])
    .controller(function( TimeSetter ) {
        TimeSetter.show({
          onSet: function(hour, minute) {
            // Do something with the values.
            // Hour is 24-hour time, 0-23.
          }
        });
    });

Available options:

KeyTypeDefaultDescription
startHourint0The default starting hour, defaults to midnight, must be in 24-hour time (0-23)
startMinuteint0The default starting minutes, defaults to 0
cancelTextstring"Cancel"Cancel button text
cancelClassstring"button-outline button-dark"Class(es) to apply to the cancel button
setTextstring"Set Time"Set button text
setClassstring"button-outline button-dark"Class(es) to apply to the set button
onSetfunctionnoneFunction to call when the "Set" button is pressed. It takes two arguments: hour and minutes