Skip to content

DevLab2425/angular-date-range

Repository files navigation

#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

About

A simple directive to produce a formatted date range display.

Resources

License

Stars

Watchers

Forks

Packages

No packages published