Skip to content

Instantly share code, notes, and snippets.

@jarcoal
Created August 5, 2013 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarcoal/6153740 to your computer and use it in GitHub Desktop.
Save jarcoal/6153740 to your computer and use it in GitHub Desktop.
MomentJS adapter for AngularJS
angular.module('moment', []).factory('moment', ['$window', function($window){
return $window.moment;
}]).filter('moment', ['moment', function(moment) {
return function(dateString, format) {
return moment(dateString).format(format);
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment