GithubHelp home page GithubHelp logo

miguelramosfdz / angular-datepicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alongubkin/angular-datepicker

0.0 1.0 0.0 522 KB

Angular.js Date/Time Picker

License: MIT License

JavaScript 83.57% CSS 16.43%

angular-datepicker's Introduction

angular-datepicker

The mobile-friendly, responsive, and lightweight Angular.js date & time input picker. Perfect for Ionic apps!

datepicker, datepicker

This is basically a pickadate.js fork that completely removes the jQuery dependency and adds Angular.js directives.

Bower

bower install angular-native-picker

Usage

Include build/angular-datepicker.js in your application:

<script src="angular-datepicker.js"></script>

Add the module angular-datepicker as a dependency to your app module:

var myapp = angular.module('myapp', ['angular-datepicker']);

To create a date or time picker, add the pick-a-date or pick-a-time directive to your input tag:

<input type="text" pick-a-date="date" placeholder="Select Date" /> {{ date }}
<input type="text" pick-a-time="time" placeholder="Select Time" /> {{ time }}

You can also provide an options object to the directive which will be passed into the pickadate or pickatime constructor.

// somewhere in your controller
$scope.options = {
  format: 'yyyy-mm-dd', // ISO formatted date
  onClose: function(e) {
    // do something when the picker closes   
  }
}
<input type="text" pick-a-date="date" pick-a-date-options="options" /> {{ date }}
<input type="text" pick-a-time="time" pick-a-time-options="options" /> {{ time }}

If you don't need to provide any callbacks (like onClose) you can specify the options object as an angular expression:

<input type="text" pick-a-date="date" pick-a-date-options="{ format: 'yyyy-mm-dd' }" />

For a full list of available options please refer to the pickadate documentation for datepicker options and timepicker options.

angular-datepicker's People

Contributors

alongubkin avatar danielcrisp avatar faceleg avatar izifortune avatar jonotron avatar ksgy avatar nachoargentina avatar piotrmarat avatar tellezhector avatar tsubik avatar wkwiatek avatar

Watchers

 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.