ngMoment

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

Added by: Sam Deering

GitHub

Repository

victorqueiroz/ngmoment

Stats

Stars: 1

Watchers: 1

Forks: 0

Module Description

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>

Module stats last updated: 2015-04-19 02:20:02

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!