Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 938 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 938 Bytes

angular-moment-duration

An AngularJS directive to modify moment.js duration objects

Requirements

  • AngularJS
  • moment.js

Usage

You can use Bower or npm to install this directive.

bower install angular-moment-duration
npm install angular-moment-duration

Add the module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['ui.moment-duration'])

The directives expects a moment.duration() object as ng-model

<input momentduration="years" ng-model="duration"/>
<input momentduration="months" ng-model="duration"/>
<input momentduration="days" ng-model="duration"/>
<input momentduration="hours" ng-model="duration"/>
<input momentduration="minutes" ng-model="duration"/>
<input momentduration="seconds" ng-model="duration"/>

Please have look in the demo folder for a working demonstration.