Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.