angular-date-range

0.1.0 • Public • Published

angular-date-range

NPM version Bower version Github version

A simple directive to produce a formatted date range display.

Installation

Download angular-date-range.min.js or install with bower

$ bower install angular-date-range --save

Load angular-date-range.min.js, then add the date-range module to your application.

angular.module('yourApp', ['date-range']);

Usage

HTML

<body ng-app="dateRangeExample">
    <div id="daterange-wrap" ng-controller="dateRangeCtrl">
        <span date-range start-date="{{startDate}}" end-date="{{endDate}}"></span>
    </div>
</body>

Javascript

angular.module('dateRangeExample', ['date-range'])
    .controller('dateRangeCtrl', ['$scope', function($scope){
        $scope.startDate = 'August 1, 2014';
        $scope.endDate = 'August 31, 2014';
    }]);

Output

August 1 - 31, 2014

Example

The example app can be launched using a simple web server, however, is dependent on a CDN hosted instance of Angular. You'll need to localize Angular to run completely local.

Development

Testing is done using Karma Test Runner.

$ grunt test

Build

$ grunt build

Package Sidebar

Install

npm i angular-date-range

Weekly Downloads

3

Version

0.1.0

License

none

Last publish

Collaborators

  • devlab2425