Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including ng-bs-daterangepicker-plus with all npm packages installed. Try it out:

ng-bs-daterangepicker-plus lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("ng-bs-daterangepicker-plus/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

ng-bs-daterangepicker-plus v0.1.0

AngularJS directive for bootstrap-daterangepicker


Angular directive for Dan Grossman's bootstrap-daterangepicker.

This is a fork of original Luis Farzati's version with a couple of incompatible fixes and localization feature.



Using bower:

bower install ng-bs-daterangepicker-plus

Using npm:

npm install ng-bs-daterangepicker-plus

How to use it

You should already have a bunch of scripts and CSS required for bootstrap-daterangepicker:

<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="daterangepicker-bs3.css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="bootstrap.min.js"></script>
<script type="text/javascript" src="moment.min.js"></script>
<script type="text/javascript" src="daterangepicker.js"></script>
<script type="text/javascript" src="angular.min.js"></script>

to the list above, you should add:

<script type="text/javascript" src="ng-bs-daterangepicker.js"></script>

Then, inject ngBootstrap.dateRangePicker in your application module:

angular.module('myApp', ['ngBootstrap.dateRangePicker']);

and then just add any element of type daterange:

<input ng-daterange type="daterange" ng-model="myDateRange">

The result object $scope.myDateRange has a startDate and endDate properties, which are instances of moment().

Implemented features so far

  • startDate, endDate: are taken from the ng-model object;
  • minDate, maxDate: mapped from min-date and max-date attributes;
  • dateLimit: mapped from limit attribute;
  • format: mapped from format attribute;
  • separator: mapped from separator attribute.
  • ranges: mapped from ranges attribute. Can be a JSON string or scoped object. (check daterangepicker for formatting)
  • locale: mapped from locale attribute. Can be a JSON string or scoped object. (check daterangepicker for formatting)

Example with all above features:

    limit="3 days"
    ranges="{'Special Range':{'startDate': '2013-09-2', 'endDate': '2013-09-5'}}">

The limit attribute lets you specify a number and unit similarly as you would invoke moment.duration().

Features to be implemented:

  • timePicker*
  • show*
  • other formatting options like *Class and stuff


You can run the tests by running

npm install
bower install

assuming you already have grunt installed, otherwise you also need to do:

npm install -g grunt-cli
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free