Code Monkey home page Code Monkey logo

ionic-timepicker's Introduction

##Introduction:

This is a ionic-timepicker bower component which can be used with any Ionic framework's application.

View Demo

##Prerequisites.

  1. node.js, bower and gulp.

##How to use:

  1. In your project repository install the ionic time picker using bower

    bower install ionic-timepicker --save-dev

  2. Then you can see the following directory structure see in your project folder

Directory Structure

Give the path of style.css, templates.js and ionic-timepicker.js in your index.html file.

<link href="lib/ionic-timepicker/dist/style.css" rel="stylesheet">

<!-- path to ionic/angularjs js -->
<script src="lib/ionic-timepicker/dist/templates.js"></script>
<script src="lib/ionic-timepicker/dist/ionic-timepicker.js"></script>
  1. In your application module inject the dependency ionic-timepicker, in order to work with the ionic time picker
angular.module('modulename', ['ionic', 'ionic-timepicker']){

}
  1. Use the below format in your template's corresponding controller
$scope.slots = {epochTime: 12600, format: 12, step: 15};
  1. Then use the below format in your template / html file
<ionic-timepicker etime="slots.epochTime" format="slots.format" step="slots.step" set-callback="setPressed();" close-callback="closePressed();">
	<button class="button button-block button-positive"> {{slots.epochTime}} </button>
</ionic-timepicker>

a) ionic-timepicker is the directive, to which we can pass required vales.

b) etime takes epoch time, which will be converted to UTC.

c) format indicates 12 hour or 24 hour format. It can take two values, 12 or 24.

d) step indicates minute increment. It can take two values, 1 or 15.

e) set-callback is a function defined on your scope that will be called when the time is set, you can pass the time selected in epoch using setPressed(slots.epochTime);.

f) close-callback is a function defined on your scope that will be called when the close button is tapped on the time selection modal.

You can also use any of my directives to convert the epoch time to string format.

Tested with angular#1.3.6 and ionic#1.0.0-beta.14.

##Screen Shots:

12-Hour 24-Hour

##Versions:

1) v0.1.0

The whole time picker functionality has been implemented, and can be installed with

bower install ionic-timepicker --save

2) v0.1.1

Directive name has been modified.

2) v0.1.2

If the minutes and hours are less than 10, then 0 will be prepended to the value of minutes/hours.

##License: MIT

##Contact: gmail : [email protected]

github : https://github.com/rajeshwarpatlolla

twitter : https://twitter.com/rajeshwar_9032

facebook : https://www.facebook.com/rajeshwarpatlolla

paypal : [email protected]

ionic-timepicker's People

Contributors

rajeshwarpatlolla avatar michaelkuhinica avatar

Watchers

 avatar James Cloos avatar

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.