Skip to content

VictorQueiroz/ngMoment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngMoment

A module to help you to integrate Moment.js and AngularJS

Demos

Live example

Issues

Do you have some issue? Let us know: https://github.com/VictorQueiroz/ngMoment/issues

Installation

bower install ng-moment --save

Usage

angular
  .module('app', ['ngMoment'])

  .run(['$moment', function ($moment) {
		$moment.locale('pt-br');
  }])
  
  .controller('MainCtrl', ['$moment', function ($moment) {
    $scope.someDate = moment().format();
  }]);

Filters

<tr ng-repeat="user in users">
	<td ng-bind="user._id"></td>
	<td ng-bind="user.name"></td>
	<td>{{ user.created_at | moment | momentFromNow }}</td>
	<td>{{ user.created_at | moment | momentAdd:'months':3 | momentFromNow }}</td>
	<td>{{ user.created_at | moment | momentFormat }}</td>
	<td>{{ user.created_at | momentFromNow }}</td> <!-- Less watchers, better for performance. -->
</tr>

About

A module to help you to integrate Moment.js and AngularJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published