Giter Site home page Giter Site logo

lamstutz / angular-date-range-picker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from monterail/angular-date-range-picker

0.0 1.0 0.0 1.02 MB

Pure Angular date range picker, no jQuery

License: MIT License

CoffeeScript 53.15% CSS 37.49% HTML 9.36%

angular-date-range-picker's Introduction

This project has been discontinued and is no longer supported

Please use angular-mighty-datepicker instead. It's superior in every way, you won't regret it.

Pure Angular Datepicker, without jQuery

Install

bower install angular-date-range-picker

Usage

// require dateRangePicker module as dependency
angular.module('myApp', ['dateRangePicker']);
// specify default date range in controller
$scope.dates = moment().range("2012-11-05", "2013-01-25")
<!-- use 'date-range-picker' directive in view -->
<input type="text" date-range-picker ng-model="dates"/>

Customizations

Simple date picker

You can also select only one date:

<!-- use 'date-range-picker' directive in view -->
<input type="text" date-range-picker ranged="false"/>

Select range options

$scope.rangeSelectOptions = [
  {
    label: "This year",
    range: moment().range(
      moment().startOf("year").startOf("day"),
      moment().endOf("year").startOf("day")
    )
  },
  {
    label: "Last year",
    range: moment().range(
      moment().startOf("year").add(-1, "year").startOf("day"),
      moment().add(-1, "year").endOf("year").startOf("day")
    )
  }
]
<input type="text" date-range-picker ng-model="dates" custom-select-options="rangeSelectOptions" />

Angular version compatibility table

Due to usage of track by $index it is impossible to provide one version for both angular < 1.2 and >= 1.2.

Angular version date-range-picker version
1.2.x0.3.x
1.1.x0.2.x
1.0.x0.2.x

Development

npm install
bower install
grunt watch
open test/index.html

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

angular-date-range-picker's People

Contributors

chytreg avatar hodak avatar jandudulski avatar jastkand avatar jcieslar avatar nicieja avatar teamon avatar tommy92 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.